Re: Compiler warning
- From: Chris Torek <nospam@xxxxxxxxx>
- Date: 31 Jul 2008 12:26:02 GMT
In article <4891adbd$0$41657$4fafbaef@xxxxxxxxxxxxxxxxxxx>,
mattia <gervaz@xxxxxxxxx> wrote:
Hi all, I've got to use this declaration:
unsigned long h = 2166136261;
but the gcc compiler warns me saying "warning: this decimal constant is
unsigned only in ISO C90".
What should I do?
You do not *have* to do anything, but your best bet is to write an
unsigned long constant, so that it is unsigned long in C99 as well:
unsigned long h = 2166136261UL;
The U suffix means "unsigned" and the L suffix means "long", and
as with declarations, the letters can appear in either order, but
"UL" is more conventional than "LU". (Unlike declarations, the
letters can also be either lowercase or uppercase, but lowercase
L is too-often mistaken for the digit 1, so stick with uppercase.)
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: gmail (figure it out) http://web.torek.net/torek/index.html
.
- Follow-Ups:
- Re: Compiler warning
- From: mattia
- Re: Compiler warning
- References:
- Compiler warning
- From: mattia
- Compiler warning
- Prev by Date: Re: stream io in c
- Next by Date: Re: A basic question question about volatile use
- Previous by thread: Re: Compiler warning
- Next by thread: Re: Compiler warning
- Index(es):
Relevant Pages
|