This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc: inet6_rth_init returned an abnormal address?


On 2014/12/16 17:41, Florian Weimer wrote:
> On 12/16/2014 10:34 AM, wangyufen wrote:
> 
>> In netinet/in.h,  inet6_rth_init() is controled by macro __USE_GNU ,
>>
>> add "#define __USE_GNU" before #include <netinet/in.h>, that would be OK.
> 
> This is incorrect, you must define _GNU_SOURCE instead.
> 
ok, thanks a lot.

I find this: _GNU_SOURCE is the only one you should ever define yourself. __USE_GNU is defined internally through a mechanism in features.h (which is included by all other glibc headers) when _GNU_SOURCE is defined, and possibly under other conditions. Defining or undefining __USE_GNU yourself will badly break the glibc headers.

I can also use gcc -D_GNU_SOURCE, I think it's better.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]