Bug 40016 - regex_internal.h:185: error: integer overflow in preprocessor expression
Summary: regex_internal.h:185: error: integer overflow in preprocessor expression
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-04 13:58 UTC by happyarch
Modified: 2009-05-04 14:52 UTC (History)
1 user (show)

See Also:
Host: x86_64
Target: x86_64
Build: x86_64
Known to work:
Known to fail:
Last reconfirmed:


Attachments
.i file (52.63 KB, application/octet-stream)
2009-05-04 13:59 UTC, happyarch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description happyarch 2009-05-04 13:58:40 UTC
Hi, when i compiling gnu parted 1.8.8 with gcc 4.5.0, got error

include regex.i

TIA
=========================================================================
/bin/sh ../libtool --tag=CC   --mode=compile gcc -std=gnu99  -I.     -Os -Werror -MT regex.lo -MD -MP -MF .deps/regex.Tpo -c -o regex.lo regex.c
 gcc -std=gnu99 -I. -Os -Werror -MT regex.lo -MD -MP -MF .deps/regex.Tpo -c regex.c  -fPIC -DPIC -o .libs/regex.o
cc1: warnings being treated as errors
In file included from regex.c:58:
regex_internal.h:185: error: integer overflow in preprocessor expression
make[2]: *** [regex.lo] Error 1
make[2]: Leaving directory `/home/user/d/parted-1.8.8/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/user/d/parted-1.8.8/lib'
make: *** [all-recursive] Error 1
bash-4.0$ cc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-bootstrap --disable-multilib
Thread model: posix
gcc version 4.5.0 20090503 (experimental) (GCC) 
bash-4.0$
Comment 1 happyarch 2009-05-04 13:59:32 UTC
Created attachment 17795 [details]
.i file
Comment 2 Richard Biener 2009-05-04 14:23:41 UTC
Works for me.
Comment 3 Jakub Jelinek 2009-05-04 14:52:32 UTC
Not surprisingly when the error is during preprocessing.
regex.h parted ships (why?) is broken by the #elif changes, there is:
#if some_condition_that_is_true_on_sane_targets
...
#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff
/* Work around a bug in 64-bit PGC (before version 6.1-2), where the 
   preprocessor mishandles large unsigned values as if they were signed.  */
...
#endif

To make GCC happy about this at least the #elif should be changed into #else #if ... #endif.