C backend: fix a couple of C warnings on Linux

pull/2185/head^2
Delyan Angelov 2019-10-01 14:35:59 +03:00 committed by Alexander Medvednikov
parent 243626c7c1
commit 2ac80485c0
3 changed files with 2 additions and 4 deletions

View File

@ -18,8 +18,6 @@ pub:
// Private function, used by V (`nums := []int`) // Private function, used by V (`nums := []int`)
fn new_array(mylen, cap, elm_size int) array { fn new_array(mylen, cap, elm_size int) array {
a := 3
_ = a
//println(a) //println(a)
arr := array { arr := array {
len: mylen len: mylen

View File

@ -38,7 +38,7 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
if C.backtrace_symbols_fd != 0 { if C.backtrace_symbols_fd != 0 {
buffer := [100]byteptr buffer := [100]byteptr
nr_ptrs := C.backtrace(*voidptr(buffer), 100) nr_ptrs := C.backtrace(*voidptr(buffer), 100)
C.backtrace_symbols_fd(&buffer[skipframes], nr_ptrs-skipframes, 1) C.backtrace_symbols_fd(*voidptr(&buffer[skipframes]), nr_ptrs-skipframes, 1)
return return
}else{ }else{
C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n') C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n')

View File

@ -179,7 +179,7 @@ pub fn (n i64) hex() string {
19 19
} }
hex := malloc(len) hex := malloc(len)
count := int(C.sprintf(*char(hex), '0x%llx', n)) count := int(C.sprintf(*char(hex), '0x%lx', n))
return tos(hex, count) return tos(hex, count)
} }