This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc: inet6_rth_init returned an abnormal address?
- From: wangyufen <wangyufen at huawei dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: OndÅej BÃlka <neleai at seznam dot cz>, <libc-alpha at sourceware dot org>
- Date: Wed, 17 Dec 2014 11:52:05 +0800
- Subject: Re: glibc: inet6_rth_init returned an abnormal address?
- Authentication-results: sourceware.org; auth=none
- References: <5489640C dot 2050400 at huawei dot com> <20141211104142 dot GA10717 at domone> <548A4F1C dot 2020009 at huawei dot com> <20141212161149 dot GB7878 at domone> <548BE50D dot 7060607 at huawei dot com> <548FFC95 dot 6010508 at huawei dot com> <548FFE62 dot 7080702 at redhat dot com>
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.