If I'm right, please investigate why LONG_WIDTH is wrong for your build configuration. The symptoms are that of a 32-bit build with a 64-bit C preprocessor, at least as far as __LONG_WIDTH__ is concerned. If this is a common-enough platform error then I suppose Gnulib should work around the implementation bug.
If I'm wrong, please run the following commands and send a compressed copy of resulting width.i file.
cd gnulib-testsgcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -DIN_GREP_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../lib -I./../lib -I/usr/include/pcre -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -E -dD test-limits-h.c >width.i
You mentioned gcc-6.2.1. For what it's worth I didn't observe a problem on Fedora 24, which has gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2). A compressed copy of my width.i file is attached, for comparison. I built with "./configure --without-included-regex --disable-silent-rules CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables'".
#include <limits.h> #include <stdio.h> int main (void) { int n = sizeof (long); printf ("sizeof(long)=%d LONG_WIDTH=%d LONG_MIN=%ld LONG_MAX=%ld\n", n, LONG_WIDTH, LONG_MIN, LONG_MAX); return 0; }
width.i.gz
Description: application/gzip