home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / gcc / bug / 3074 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.2 KB  |  36 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ma2s2.mathematik.uni-karlsruhe.de!haible
  3. From: haible@ma2s2.mathematik.uni-karlsruhe.de (Bruno Haible)
  4. Subject: misleading "limited range" warning
  5. Message-ID: <9212291132.AA19062@ma2s2.mathematik.uni-karlsruhe.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 29 Dec 1992 13:32:38 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 23
  12.  
  13. Compiling the following
  14.  
  15. =============================== warntest.c ==============================
  16. int foo ()
  17. { if (0xFFFFFFFFULL & -1LL) return 4; else return 1; }
  18. =========================================================================
  19.  
  20. using  "gcc -V 2.3.3 -c -W warntest.c"  produces the warning
  21.  
  22. warntest.c: In function `foo':
  23. warntest.c:2: warning: comparison is always 1 due to limited range of data type
  24.  
  25. This is misleading: If the "comparison" ((0xFFFFFFFFULL & -1LL) != 0)
  26. evaluates to 1 for a certain data type, then it evaluates to 1 for every
  27. larger integer data type (in this case even for every integer data type).
  28.  
  29. I'm using gcc 2.3.3, configured i386-linux.
  30. Btw, long long on i386 now work perfectly. Congratulations!
  31.  
  32.  
  33. Bruno Haible
  34. haible@ma2s2.mathematik.uni-karlsruhe.de
  35.  
  36.