summary refs log tree commit diff stats
path: root/lib/posix
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2015-10-02 16:00:33 -0700
committerAman Gupta <aman@tmm1.net>2015-10-02 16:00:33 -0700
commit2f7802bea3f27eae92b828b0cb3d49b451f10839 (patch)
tree0fa1879400c9e2b9c5f84ad1d0d59cb9a729c022 /lib/posix
parent59d226221b3a4502a275038e65c34107130fc4ce (diff)
downloadNim-2f7802bea3f27eae92b828b0cb3d49b451f10839.tar.gz
fix rawsockets test
FAIL: trawsockets.nim
Test "tests/cpp/trawsockets.nim" in category "cpp"
Failure: reNimcCrash
Expected:

Gotten:
Hint: system [Processing]
Hint: trawsockets [Processing]
Hint: rawsockets [Processing]
Hint: unsigned [Processing]
lib/pure/rawsockets.nim(15, 8) Warning: unsigned is deprecated [Deprecated]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
CC: compiler_trawsockets
CC: stdlib_system
CC: stdlib_rawsockets
CC: stdlib_unsigned
CC: stdlib_os
CC: stdlib_strutils
Error: execution of an external compiler program 'clang++ -c  -w  -I/Users/tmm1/code/nim/lib -o tests/cpp/nimcache/stdlib_rawsockets.o tests/cpp/nimcache/stdlib_rawsockets.cpp' failed with exit code: 256

tests/cpp/nimcache/stdlib_rawsockets.cpp:355:8: error: assigning to 'NCSTRING' (aka 'char *') from incompatible type 'const char *'
                LOC6 = gai_strerror(gairesult);
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~
tests/cpp/nimcache/stdlib_rawsockets.cpp:499:8: error: assigning to 'NCSTRING' (aka 'char *') from incompatible type 'const char *'
                LOC5 = hstrerror(h_errno);
                     ^ ~~~~~~~~~~~~~~~~~~
tests/cpp/nimcache/stdlib_rawsockets.cpp:650:8: error: assigning to 'NCSTRING' (aka 'char *') from incompatible type 'const char *'
                LOC9 = inet_ntop(AF_INET6, ((void*) (addr6)), result->data, ((NI32)chckRange((result ? result->len : 0), ((NI32) (-2147483647 -1)), ((NI32) 2147483647))));
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests/cpp/nimcache/stdlib_rawsockets.cpp:771:10: error: assigning to 'NCSTRING' (aka 'char *') from incompatible type 'const char *'
                        LOC17 = inet_ntop(name.sin6_family, ((void*) ((&name))), ((NCSTRING) (buf)), ((NI32)chckRange(((NI)sizeof(TY143006)), ((NI32) (-2147483647 -1)), ((NI32) 2147483647))));
                              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests/cpp/nimcache/stdlib_rawsockets.cpp:859:10: error: assigning to 'NCSTRING' (aka 'char *') from incompatible type 'const char *'
                        LOC17 = inet_ntop(name.sin6_family, ((void*) ((&name))), ((NCSTRING) (buf)), ((NI32)chckRange(((NI)sizeof(TY143006)), ((NI32) (-2147483647 -1)), ((NI32) 2147483647))));
                              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 errors generated.
Diffstat (limited to 'lib/posix')
-rw-r--r--lib/posix/posix.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 8486fa04f..5f1dfcfcd 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -1810,7 +1810,7 @@ proc ntohs*(a1: int16): int16 {.importc, header: "<arpa/inet.h>".}
 proc inet_addr*(a1: cstring): InAddrT {.importc, header: "<arpa/inet.h>".}
 proc inet_ntoa*(a1: InAddr): cstring {.importc, header: "<arpa/inet.h>".}
 proc inet_ntop*(a1: cint, a2: pointer, a3: cstring, a4: int32): cstring {.
-  importc, header: "<arpa/inet.h>".}
+  importc:"(char *)$1", header: "<arpa/inet.h>".}
 proc inet_pton*(a1: cint, a2: cstring, a3: pointer): cint {.
   importc, header: "<arpa/inet.h>".}
 
@@ -2381,7 +2381,7 @@ proc sched_setscheduler*(a1: Pid, a2: cint, a3: var Sched_param): cint {.
 proc sched_yield*(): cint {.importc, header: "<sched.h>".}
 
 proc strerror*(errnum: cint): cstring {.importc, header: "<string.h>".}
-proc hstrerror*(herrnum: cint): cstring {.importc, header: "<netdb.h>".}
+proc hstrerror*(herrnum: cint): cstring {.importc:"(char *)$1", header: "<netdb.h>".}
 
 proc FD_CLR*(a1: cint, a2: var TFdSet) {.importc, header: "<sys/select.h>".}
 proc FD_ISSET*(a1: cint | SocketHandle, a2: var TFdSet): cint {.
@@ -2565,7 +2565,7 @@ proc endprotoent*() {.importc, header: "<netdb.h>".}
 proc endservent*() {.importc, header: "<netdb.h>".}
 proc freeaddrinfo*(a1: ptr AddrInfo) {.importc, header: "<netdb.h>".}
 
-proc gai_strerror*(a1: cint): cstring {.importc, header: "<netdb.h>".}
+proc gai_strerror*(a1: cint): cstring {.importc:"(char *)$1", header: "<netdb.h>".}
 
 proc getaddrinfo*(a1, a2: cstring, a3: ptr AddrInfo,
                   a4: var ptr AddrInfo): cint {.importc, header: "<netdb.h>".}