{"action":"created","issue":{"url":"https://api.github.com/repos/cnlohr/cnping/issues/46","repository_url":"https://api.github.com/repos/cnlohr/cnping","labels_url":"https://api.github.com/repos/cnlohr/cnping/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/cnlohr/cnping/issues/46/comments","events_url":"https://api.github.com/repos/cnlohr/cnping/issues/46/events","html_url":"https://github.com/cnlohr/cnping/issues/46","id":341455215,"node_id":"MDU6SXNzdWUzNDE0NTUyMTU=","number":46,"title":"Mac compile error: MSG_NOSIGNAL","user":{"login":"mischnic","id":4586894,"node_id":"MDQ6VXNlcjQ1ODY4OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4586894?v=4","gravatar_id":"","url":"https://api.github.com/users/mischnic","html_url":"https://github.com/mischnic","followers_url":"https://api.github.com/users/mischnic/followers","following_url":"https://api.github.com/users/mischnic/following{/other_user}","gists_url":"https://api.github.com/users/mischnic/gists{/gist_id}","starred_url":"https://api.github.com/users/mischnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mischnic/subscriptions","organizations_url":"https://api.github.com/users/mischnic/orgs","repos_url":"https://api.github.com/users/mischnic/repos","events_url":"https://api.github.com/users/mischnic/events{/privacy}","received_events_url":"https://api.github.com/users/mischnic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-16T09:56:54Z","updated_at":"2018-07-16T12:15:48Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Not sure whether cnping or cnping_mac is the correct target, but both don't compile on macOS (10.13):\r\n\r\n```\r\n$ make cnping\r\ncc  -g -Os -I/opt/X11/include -Wall   -c -o httping.o httping.c\r\nhttping.c:96:36: error: use of undeclared identifier 'MSG_NOSIGNAL'\r\n                int rs = send( httpsock, buf, n, MSG_NOSIGNAL );\r\n                                                 ^\r\n1 error generated.\r\nmake: *** [<builtin>: httping.o] Error 1\r\n```\r\n\r\n\r\n```\r\n$ make cnping_mac\r\ngcc -o cnping cnping.c CNFGFunctions.c CNFGCocoaCGDriver.m os_generic.c ping.c -x objective-c -framework Cocoa -framework QuartzCore -lm -lpthread\r\ncnping.c:344:27: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]\r\n                        sprintf( stbuf, \"%lu\", samps );\r\n                                         ~~~   ^~~~~\r\n                                         %llu\r\n/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'\r\n  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)\r\n                                                       ^~~~~~~~~~~\r\ncnping.c:358:55: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]\r\n                        pinghost, globmaxtime*1000.0, globinterval*1000.0, globallost, globalrx, globallost*100.0/(globalrx+globallost) );\r\n                                                                           ^~~~~~~~~~\r\n/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'\r\n  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)\r\n                                                             ^~~~~~~~~~~\r\ncnping.c:358:67: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]\r\n                        pinghost, globmaxtime*1000.0, globinterval*1000.0, globallost, globalrx, globallost*100.0/(globalrx+globallost) );\r\n                                                                                       ^~~~~~~~\r\n/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'\r\n  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)\r\n                                                             ^~~~~~~~~~~\r\ncnping.c:478:3: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]\r\n                globallost, globalrx, globallost*100.0f/(globalrx+globallost), loss );\r\n                ^~~~~~~~~~\r\n/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'\r\n  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)\r\n                                                       ^~~~~~~~~~~\r\ncnping.c:478:15: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]\r\n                globallost, globalrx, globallost*100.0f/(globalrx+globallost), loss );\r\n                            ^~~~~~~~\r\n/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'\r\n  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)\r\n                                                       ^~~~~~~~~~~\r\n5 warnings generated.\r\nos_generic.c:281:2: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]\r\n        sem_init( sem, 0, 0 );\r\n        ^\r\n/usr/include/sys/semaphore.h:55:42: note: 'sem_init' has been explicitly marked deprecated here\r\nint sem_init(sem_t *, int, unsigned int) __deprecated;\r\n                                         ^\r\n/usr/include/sys/cdefs.h:176:37: note: expanded from macro '__deprecated'\r\n#define __deprecated    __attribute__((deprecated))\r\n                                       ^\r\nos_generic.c:288:2: warning: 'sem_getvalue' is deprecated [-Wdeprecated-declarations]\r\n        sem_getvalue( os, &valp );\r\n        ^\r\n/usr/include/sys/semaphore.h:54:56: note: 'sem_getvalue' has been explicitly marked deprecated here\r\nint sem_getvalue(sem_t * __restrict, int * __restrict) __deprecated;\r\n                                                       ^\r\n/usr/include/sys/cdefs.h:176:37: note: expanded from macro '__deprecated'\r\n#define __deprecated    __attribute__((deprecated))\r\n                                       ^\r\nos_generic.c:305:2: warning: 'sem_destroy' is deprecated [-Wdeprecated-declarations]\r\n        sem_destroy( os );\r\n        ^\r\n/usr/include/sys/semaphore.h:53:26: note: 'sem_destroy' has been explicitly marked deprecated here\r\nint sem_destroy(sem_t *) __deprecated;\r\n                         ^\r\n/usr/include/sys/cdefs.h:176:37: note: expanded from macro '__deprecated'\r\n#define __deprecated    __attribute__((deprecated))\r\n                                       ^\r\n3 warnings generated.\r\nping.c:58:4: warning: declaration does not declare anything [-Wmissing-declarations]\r\n                        uint16_t        __unused;\r\n                        ^~~~~~~~\r\n1 warning generated.\r\nUndefined symbols for architecture x86_64:\r\n  \"_StartHTTPing\", referenced from:\r\n      _main in cnping-a4c237.o\r\nld: symbol(s) not found for architecture x86_64\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\nmake: *** [Makefile:24: cnping_mac] Error 1\r\n```\r\n\r\nThe second error can be reduced to the first with:\r\n```diff\r\ndiff --git a/Makefile b/Makefile\r\nindex 63f799e..b0c9fcc 100644\r\n--- a/Makefile\r\n+++ b/Makefile\r\n@@ -20,7 +20,7 @@ cnping : cnping.o CNFGFunctions.o CNFGXDriver.o os_generic.o ping.o httping.o\r\n cnping-mousey : cnping-mousey.o CNFGFunctions.o CNFGXDriver.o os_generic.o ping.o\r\n        gcc $(CFLAGS) -o $@ $^ -lX11 -lm -lpthread $(LDFLAGS)\r\n\r\n-cnping_mac : cnping.c CNFGFunctions.c CNFGCocoaCGDriver.m os_generic.c ping.c\r\n+cnping_mac : cnping.c CNFGFunctions.c CNFGCocoaCGDriver.m os_generic.c ping.c httping.c\r\n        gcc -o cnping $^ -x objective-c -framework Cocoa -framework QuartzCore -lm -lpthread\r\n\r\n cnping-mousey_mac : cnping-mousey.c CNFGFunctions.c CNFGCocoaCGDriver.m os_generic.c ping.c\r\n```"},"comment":{"url":"https://api.github.com/repos/cnlohr/cnping/issues/comments/405228354","html_url":"https://github.com/cnlohr/cnping/issues/46#issuecomment-405228354","issue_url":"https://api.github.com/repos/cnlohr/cnping/issues/46","id":405228354,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTIyODM1NA==","user":{"login":"mischnic","id":4586894,"node_id":"MDQ6VXNlcjQ1ODY4OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4586894?v=4","gravatar_id":"","url":"https://api.github.com/users/mischnic","html_url":"https://github.com/mischnic","followers_url":"https://api.github.com/users/mischnic/followers","following_url":"https://api.github.com/users/mischnic/following{/other_user}","gists_url":"https://api.github.com/users/mischnic/gists{/gist_id}","starred_url":"https://api.github.com/users/mischnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mischnic/subscriptions","organizations_url":"https://api.github.com/users/mischnic/orgs","repos_url":"https://api.github.com/users/mischnic/repos","events_url":"https://api.github.com/users/mischnic/events{/privacy}","received_events_url":"https://api.github.com/users/mischnic/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T12:15:48Z","updated_at":"2018-07-16T12:15:48Z","author_association":"CONTRIBUTOR","body":"Would the Windows \"solution\" work for macOS as well?\r\nhttps://github.com/cnlohr/cnping/blob/67bf9b73eefe1de63bed8608e7cb79250bea5f3d/httping.c#L9-L13"}}
{"actor":{"display_login":"mischnic"}}