uber-archive / statsrelay

A consistent-hashing relay for statsd and carbon metrics
Other
101 stars 28 forks source link

Gcc 4.8 is picky, strdup is not available in C99... #43

Closed artms closed 9 years ago

eklitzke commented 9 years ago

This is a libc issue, not a gcc issue (strdup is part of libc, not the C compiler). Also, the correct way to fix this is using the feature test macros.

On the two systems I have available (glibc 2.15, and glibc 2.20, which is the latest stable glibc release) the man page says:

       strdup():
           _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 ||
           _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
           || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
       strndup():
           Since glibc 2.10:
               POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
           Before glibc 2.10:
               _GNU_SOURCE

and the src/Makefile.am does set _XOPEN_SOURCE=700.

Can you take a look at your libc and see what feature test macros it wants?

artms commented 9 years ago

Yeap, retested - everything seems to be OK, I did not use all the flags to compile files...