This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] ARM: Don't define _SYS_AUXV_H in sysdep.h
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 16 Sep 2014 21:47:49 +0000
- Subject: Re: [PATCH] ARM: Don't define _SYS_AUXV_H in sysdep.h
- Authentication-results: sourceware.org; auth=none
- References: <1410517868-11916-1-git-send-email-will dot newton at linaro dot org> <Pine dot LNX dot 4 dot 64 dot 1409121703270 dot 1118 at digraph dot polyomino dot org dot uk> <CANu=Dmhv7vr7FNJ5aq1Y+3LY9LWQC5syZuo4CbsPQWjayJFkDA at mail dot gmail dot com>
On Tue, 16 Sep 2014, Will Newton wrote:
> On 12 September 2014 10:04, Joseph S. Myers <joseph@codesourcery.com> wrote:
> > On Fri, 12 Sep 2014, Will Newton wrote:
> >
> >> sysdep.h was defining _SYS_AUXV_H in order to avoid an include guard check
> >> in hwcap.h. Unfortunately it didn't undefine it so it could leak out into
> >> code and caused a build failure with -Wimplicit-function-declaration
> >> building tst-auxv on ARM.
> >>
> >> ChangeLog:
> >>
> >> 2014-09-11 Will Newton <will.newton@linaro.org>
> >>
> >> * sysdeps/unix/sysv/linux/arm/bits/hwcap.h: Check for
> >> _LINUX_ARM_SYSDEP_H include guard too.
> >
> > Rather than referring to a guard for an internal header in an installed
> > header, I think it would be better to test for _LIBC there.
>
> This approach (testing for the sysdep.h guard) is used in sparc and
> powerpc at present. Testing _LIBC would work but
OK for the original patch then, but please file a bug in Bugzilla to
eliminate such ad hoc conditionals from installed headers. In general
installed headers should have as little as possible that's not actually
relevant for use of the installed library, and the particular set of
conditionals used in installed headers in such cases should be minimal
(_LIBC and _LIBC_TEST?).
> stdio-common/scanf15.c and stdio-common/scanf17.c both #undef _LIBC
> and break things.
Why does sysdep.h get included from these testcases anyway? As well as
moving away from defining _LIBC (and other internal defines) for tests
unless needed for a particular test, it would also be good to move away
from tests using the internal includes (if such an include is responsible
here), instead making them use the versions of headers that actually get
installed before looking for any other headers in the source tree or
sysdeps directories.
--
Joseph S. Myers
joseph@codesourcery.com