Re: Compiler warning



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
.



Relevant Pages

  • Re: Compiler warning
    ... but the gcc compiler warns me saying "warning: this decimal constant is ... declarations, the letters can appear in either order, but "UL" is more ... either lowercase or uppercase, but lowercase L is too-often mistaken for ... the digit 1, so stick with uppercase.) ...
    (comp.lang.c)
  • Re: main - argv lowercase strings
    ... that the implementation provide main's ``argv'' strings in lowercase if the ... host environment is not capable of supply both uppercase and lowercase ... such an implementation capable of only uppercase letters, ...
    (comp.lang.c)
  • Re: Problem with lower case umlauts.
    ... uppercase letters with an umlaut. ... create lowercase letters with umlauts. ... I've seen various instruction on what one should do to for lowercase ...
    (microsoft.public.word.docmanagement)
  • help needed with a C program
    ... Write a program that opens an existing text file and copies it to a ... my program converts all lowercase letters to uppercase letters, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Changing the primary e-mailaddress automatically for all users.
    ... The solution you pointed at did work, but I want to convert uppercase ... letters to lowercase. ... Is there a replacement string for that to? ...
    (microsoft.public.exchange2000.admin)