Help replacing ULL to eliminate pedantic error that ULL is C99

Stephen Torri storri@torri.org
Thu Apr 5 20:43:00 GMT 2007


On Thu, 2007-04-05 at 09:21 -0500, John Love-Jensen wrote:
> Hi Stephen,
> 
> > I have a c++ program that has some 64-bit constants. How can I replace
> > ULL in my code so that I can tell g++ that the constants are 64-bits
> > long when I use the -ansi -pedantic flags?
> 
> Use the -Wno-long-long flag as well.
> 
> Also, perhaps, consider using/adapting C99's <stdint.h> facilities:
> 
> uint64_t i = UINT64_C(0x00ff000000000000);
> 
> HTH,
> --Eljay
> 

The idea of using/adapting C99 facilities still does not remove the
warning for the first three constant values. I am not sure using that
macro is the right idea. What removed the warning message was the flag
you suggested. Is my use of a 64-bit constant valid?

Stephen



More information about the Gcc-help mailing list