preprocessor/8139: Bad new INT64_C macro

philippe_ribet@hotmail.com philippe_ribet@hotmail.com
Fri Oct 4 02:26:00 GMT 2002


>Number:         8139
>Category:       preprocessor
>Synopsis:       Bad new INT64_C macro
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 04 02:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     philippe_ribet@hotmail.com
>Release:        3.2
>Organization:
>Environment:

>Description:
Old INT64_C macro definition was value ## LL.

New definition is probably better but then the compiler has to be modified accordingly.

Note that all values are valid 64 bit numbers.
The bug occured in the range -2^32+1 .. -2^31.
>How-To-Repeat:
#include <inttypes.h>

main(){
  int64_t v;

  v = INT64_C(-2147483648);
  v = INT64_C(-3000000000);
  v = INT64_C(-4000000000);
  v = INT64_C(-5000000000);
}

$ gcc t.c
t.c: In function `main':
t.c:6: warning: decimal constant is so large that it is unsigned
t.c:7: warning: decimal constant is so large that it is unsigned
t.c:8: warning: decimal constant is so large that it is unsigned

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list