Description of problem: LONG_WIDTH is incorrectly set to the 64 on 32 bit platforms. Version-Release number of selected component (if applicable): gcc-6.2.1-2.fc26.i686 How reproducible: Always Steps to Reproduce: 1. mock -r fedora-rawhide-i386 chroot 2. gcc -D_GNU_SOURCE -o width width.c 3. ./width Actual results: sizeof(long)=4 LONG_WIDTH=64 LONG_MIN=-2147483648 LONG_MAX=2147483647 Expected results: sizeof(long)=4 LONG_WIDTH=32 LONG_MIN=-2147483648 LONG_MAX=2147483647 Additional info: I think the reason is the following new code from the /usr/include/limits.h: /* The integer width macros are not defined by GCC's <limits.h> before GCC 7, or if _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) ... # 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 # endif but LONG_MAX is not defined in the check, it's defined later thus LONG_WIDTH is incorrectly set to the 64 even on 32 bit platforms. I think the check should be rewritten to the following: # if __LONG_MAX__ == 0x7fffffffL It's blocking build (make check) of the grep-2.26, koji build log with the failure: https://kojipkgs.fedoraproject.org/work/tasks/8044/15928044/build.log
(In reply to Jaroslav Škarvada from comment #0) > Steps to Reproduce: > 1. mock -r fedora-rawhide-i386 chroot Should be mock -r fedora-rawhide-i386 shell
Created attachment 1207189 [details] Reproducer
glibc-2.24.90-8.fc26.i686
Created attachment 1207198 [details] Proposed host fix This host fix fixed the problem for me.
gcc -Wundef -Wsystem-headers gives: In file included from /usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/limits.h:168:0, from /usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/syslimits.h:7, from /usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/limits.h:34, from u.c:1: /usr/include/limits.h:167:6: warning: "LONG_MAX" is not defined [-Wundef] # if LONG_MAX == 0x7fffffffL ^~~~~~~~
grep-2.26-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-6c2e016299
grep-2.26-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.