troglobit/netcalc

Compile on macOS?

luckman212 opened this issue ยท 5 comments

I would really like to compile netcalc on macOS, but fell on my face.

configure runs fine (no errors). But make spews out the following wall of text and then fails. Any possible clue or is this a dead end?

$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
  CC       netcalc-netcalc.o
In file included from netcalc.c:40:
./netcalc.h:232:8: error: expected parameter declarator
size_t strlcpy(char *dst, const char *src, size_t siz);
       ^
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
In file included from netcalc.c:40:
./netcalc.h:232:8: error: expected ')'
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
./netcalc.h:232:8: note: to match this '('
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                    ^
In file included from netcalc.c:40:
./netcalc.h:232:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
size_t strlcpy(char *dst, const char *src, size_t siz);
       ^
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                              ^
In file included from netcalc.c:40:
./netcalc.h:232:8: error: conflicting types for '__builtin___strlcpy_chk'
/usr/include/secure/_string.h:108:3: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                ^
./netcalc.h:232:8: note: '__builtin___strlcpy_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned
      long, unsigned long)'
/usr/include/secure/_string.h:108:3: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                ^
In file included from netcalc.c:40:
./netcalc.h:233:8: error: expected parameter declarator
size_t strlcat(char *dst, const char *src, size_t siz);
       ^
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
In file included from netcalc.c:40:
./netcalc.h:233:8: error: expected ')'
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
./netcalc.h:233:8: note: to match this '('
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                    ^
In file included from netcalc.c:40:
./netcalc.h:233:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
size_t strlcat(char *dst, const char *src, size_t siz);
       ^
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                              ^
In file included from netcalc.c:40:
./netcalc.h:233:8: error: conflicting types for '__builtin___strlcat_chk'
/usr/include/secure/_string.h:115:3: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                ^
./netcalc.h:233:8: note: '__builtin___strlcat_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned
      long, unsigned long)'
/usr/include/secure/_string.h:115:3: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                ^
2 warnings and 6 errors generated.
make[2]: *** [netcalc-netcalc.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Thanks for reporting this, gave me a chance to try out netcalc on macOS! Should work better now :)

Unless you find something else I'll start the release process for a v2.1.4

@troglobit Brilliant! That was it. I was able to compile and run. Thank you so much.

@luckman212 Awesome! I'll roll out v2.1.4 tomorrow :)

Just another thank you - I downloaded 2.1.4 today and it compiled and runs fine on macOS with nothing more than the standard ./configure && make ๐Ÿป

@luckman212 No problem mate, that's after all how it's supposed to work, glad I could help! ๐Ÿ˜ƒ