home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2824 < prev    next >
Encoding:
Text File  |  1992-11-24  |  1.7 KB  |  65 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!digtec.dtro.e-technik.TH-darmstadt.DE!stu
  3. From: stu@digtec.dtro.e-technik.TH-darmstadt.DE (Stefan Ullrich)
  4. Subject: potential gcc-error
  5. Message-ID: <9211231705.AA10393@mailhost.digtec.dtro.e-technik.th-darmstadt.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 23 Nov 1992 19:05:17 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 52
  12.  
  13. Dear Sirs,
  14.  
  15. this a bug report to gcc-2.3.1.
  16.  
  17. It is a little bug we found in the gcc-2.3.1. It causes no errors
  18. during programm execution but is a little bit confusing since you get a
  19. warning from the compiler.
  20.  
  21. The problem is that gcc-2.3.1 doesnot accept without warning the
  22. smallest possible integer for a signed long int if it is written in
  23. decimal (-2147483648).  It accepts the same value as hex number
  24. (0x80000000). It also accepts the int number (-2147483647) without
  25. warning. We havenot found any problems during execution.
  26.  
  27. We wrote a little programm to demonstrate the behaviour of gcc-2.3.1.
  28. This is the little programm called `example.c':
  29.  
  30. > #include <stdio.h>
  31. >
  32. >
  33. > int main(void){
  34. >
  35. >   long int i,j;
  36. >
  37. >   i = -2147483648;
  38. >   j = 0x80000000;
  39. >   printf("\nmax_neg_dez : %d", i);
  40. >   printf("\nmax_neg_hex : %d\n\n", j);
  41. >   return;
  42. > }
  43.  
  44. This the compiler call:
  45.  
  46. > gcc -o example example.c
  47.  
  48. This is the error message that was produced by gcc:
  49.  
  50. > example.c: In function `main':
  51. > example.c:8: warning: integer constant is so large that it is unsigned
  52.  
  53. This is the ouput produced by `example':
  54.  
  55. >
  56. > max_neg_dez : -2147483648
  57. > max_neg_hex : -2147483648
  58. >
  59.  
  60. We hope that this bug report will help to improve the new release of gcc.
  61.  
  62. Many thanks to all who worked on this compiler. It is a great advance
  63. for our work.
  64.  
  65.