Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portability: HOST_NAME_MAX is not everywhere #64

Open
jimklimov opened this issue Jun 13, 2017 · 0 comments
Open

Portability: HOST_NAME_MAX is not everywhere #64

jimklimov opened this issue Jun 13, 2017 · 0 comments
Assignees

Comments

@jimklimov
Copy link
Member

Google shows this issue popping up in many other projects too. Not all systems follow the same set of standards, and/or need to define special macros to enable those. Alternately MAXHOSTNAMELEN can be used on some systems. Note that these can have different sizes (I've seen 64, 255 and 256 in different OS samples), so if the limit is used in protocol strings it can cause some fun...

  CXX      src/src_fty_info_selftest-fty_info_selftest.o
/tmp/FTY/.srcclone/SunOS-i86pc-czmq_3/fty-info/src/fty_info_server.cc:32:28: fatal error: bits/local_lim.h: No such file or directory
 #include <bits/local_lim.h>
                            ^
compilation terminated.
gmake[2]: *** [Makefile:1032: src/src_libfty_info_la-fty_info_server.lo] Error 1
../../../.srcclone/SunOS-i86pc-czmq_3/fty-info/src/ftyinfo.cc: In function 'ftyinfo_t* ftyinfo_new(topologyresolver_t*)':
../../../.srcclone/SunOS-i86pc-czmq_3/fty-info/src/ftyinfo.cc:157:39: error: 'HOST_NAME_MAX' was not declared in this scope
     char *hostname = (char *) malloc (HOST_NAME_MAX+1);
                                       ^
gmake[2]: *** [Makefile:1025: src/src_libfty_info_la-ftyinfo.lo] Error 1
gmake[2]: Target 'all-am' not remade because of errors.
gmake[2]: Leaving directory '/tmp/FTY/.build/SunOS-i86pc-czmq_3/fty-info'
gmake[1]: *** [Makefile:1174: all-recursive] Error 1
gmake[1]: Target 'all' not remade because of errors.
@jimklimov jimklimov self-assigned this Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant