This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/42421] New: error: invalid suffix "-0x1" on integer constant when subtracting 0x1 from 0xE


When subtracting 0x1 from 0xE, the -0x1 is incorrectly parsed as a suffix.
Subtracting 0x1 from other hex constants works fine.

$ cat bug.c
int good = 0xD-0x1;
int bad = 0xE-0x1;


$ gcc -v -save-temps -c bug.c
Using built-in specs.
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch=i686
--build=i686-redhat-linux
Thread model: posix
gcc version 4.4.2 20091027 (Red Hat 4.4.2-7) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.4.2/cc1 -E -quiet -v bug.c -mtune=generic
-march=i686 -fpch-preprocess -o bug.i
ignoring nonexistent directory
"/usr/lib/gcc/i686-redhat-linux/4.4.2/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/i686-redhat-linux/4.4.2/../../../../i686-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i686-redhat-linux/4.4.2/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.4.2/cc1 -fpreprocessed bug.i -quiet
-dumpbase bug.c -mtune=generic -march=i686 -auxbase bug -version -o bug.s
GNU C (GCC) version 4.4.2 20091027 (Red Hat 4.4.2-7) (i686-redhat-linux)
        compiled by GNU C version 4.4.2 20091027 (Red Hat 4.4.2-7), GMP version
4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=127310
Compiler executable checksum: bba6b4235667b4e22536a25004e123c4
bug.c:2:11: error: invalid suffix "-0x1" on integer constant


-- 
           Summary: error: invalid suffix "-0x1" on integer constant when
                    subtracting 0x1 from 0xE
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bradley at dunn dot org
 GCC build triplet: i686-redhat-linux
  GCC host triplet: i686-redhat-linux
GCC target triplet: i686-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42421


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]