home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: sparky!uunet!cis.ohio-state.edu!digtec.dtro.e-technik.TH-darmstadt.DE!stu
- From: stu@digtec.dtro.e-technik.TH-darmstadt.DE (Stefan Ullrich)
- Subject: potential gcc-error
- Message-ID: <9211231705.AA10393@mailhost.digtec.dtro.e-technik.th-darmstadt.de>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Mon, 23 Nov 1992 19:05:17 GMT
- Approved: bug-gcc@prep.ai.mit.edu
- Lines: 52
-
- Dear Sirs,
-
- this a bug report to gcc-2.3.1.
-
- It is a little bug we found in the gcc-2.3.1. It causes no errors
- during programm execution but is a little bit confusing since you get a
- warning from the compiler.
-
- The problem is that gcc-2.3.1 doesnot accept without warning the
- smallest possible integer for a signed long int if it is written in
- decimal (-2147483648). It accepts the same value as hex number
- (0x80000000). It also accepts the int number (-2147483647) without
- warning. We havenot found any problems during execution.
-
- We wrote a little programm to demonstrate the behaviour of gcc-2.3.1.
- This is the little programm called `example.c':
-
- > #include <stdio.h>
- >
- >
- > int main(void){
- >
- > long int i,j;
- >
- > i = -2147483648;
- > j = 0x80000000;
- > printf("\nmax_neg_dez : %d", i);
- > printf("\nmax_neg_hex : %d\n\n", j);
- > return;
- > }
-
- This the compiler call:
-
- > gcc -o example example.c
-
- This is the error message that was produced by gcc:
-
- > example.c: In function `main':
- > example.c:8: warning: integer constant is so large that it is unsigned
-
- This is the ouput produced by `example':
-
- >
- > max_neg_dez : -2147483648
- > max_neg_hex : -2147483648
- >
-
- We hope that this bug report will help to improve the new release of gcc.
-
- Many thanks to all who worked on this compiler. It is a great advance
- for our work.
-
-