Message ID | alpine.DEB.2.20.1610041549540.14477@digraph.polyomino.org.uk |
---|---|
State | New |
Headers | show |
On 10/04/2016 05:51 PM, Joseph Myers wrote: > On Tue, 4 Oct 2016, Florian Weimer wrote: > >> On 10/04/2016 05:07 PM, Paul Eggert wrote: >>> On 09/16/2016 05:32 PM, Paul Eggert wrote: >>>> the patch looks good; thanks. >>> >>> Unfortunately I did not check the patch thoroughly enough, as the patch >>> turns out to define LONG_WIDTH incorrectly on i686 with >>> gcc-6.2.1-2.fc26.i686, and this causes grep's 'make check' to fail >>> (luckily these are side tests; grep itself works fine). See: >>> >>> https://bugzilla.redhat.com/show_bug.cgi?id=1381582 >> >> See comment 5 there. The problem seems to be that GCC <limits.h> is included >> first, followed by glibc <limits.h>, which then tries to get the definitions >> from GCC. But at this point, nothing happens because the GCC include guards >> cause the GCC header to be skipped. > > Presumably this is an area where include ordering with installed headers > differs from include ordering when building the glibc testsuite. Does > this patch work in the installed header context to fix the reported issue? > (I'm running tests of it in the normal glibc testsuite context.) I applied the patch to the installed header and it fixes the reported issue about LONG_WIDTH. Thanks, Florian
On Tue, 4 Oct 2016, Florian Weimer wrote: > I applied the patch to the installed header and it fixes the reported issue > about LONG_WIDTH. Thanks, I've committed the patch after my testing on x86_64 and x86 completed.
diff --git a/include/limits.h b/include/limits.h index 93cac49..dd601d5 100644 --- a/include/limits.h +++ b/include/limits.h @@ -164,20 +164,11 @@ # ifndef UINT_WIDTH # define UINT_WIDTH 32 # endif -# if LONG_MAX == 0x7fffffffL -# ifndef LONG_WIDTH -# define LONG_WIDTH 32 -# endif -# ifndef ULONG_WIDTH -# define ULONG_WIDTH 32 -# endif -# else -# ifndef LONG_WIDTH -# define LONG_WIDTH 64 -# endif -# ifndef ULONG_WIDTH -# define ULONG_WIDTH 64 -# endif +# ifndef LONG_WIDTH +# define LONG_WIDTH __WORDSIZE +# endif +# ifndef ULONG_WIDTH +# define ULONG_WIDTH __WORDSIZE # endif # ifndef LLONG_WIDTH # define LLONG_WIDTH 64