This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: too many warnings
- To: demuynck at ruca dot ua dot ac dot be
- Subject: Re: too many warnings
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Thu, 29 Oct 1998 15:00:45 +0100 (MET)
- Cc: egcs-bugs at cygnus dot com
- References: <Pine.HPP.3.96.981029102224.20346A-100000@nets.ruca.ua.ac.be>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
The warning is correct, your code is incorrect; you failed to
indicate, that the numeric literal is 'unsigned' by appending
a 'U'. If you were using
int
main (int argc, char **argv)
{
unsigned a;
a=4294967295U; // Note the 'U' here!
}
everything compiles flawlessly without a warning!
manfred
On Thu, 29 October 1998, 10:27:01, demuynck@ruca.ua.ac.be wrote:
>
> Hi,
>
> I'd like you to try and compile the next bit of code using g++:
>
> ----------------------------------
> int
> main (int argc, char **argv)
> {
> unsigned a;
>
> a=4294967295;
> }
> -----------------------------------
>
> You will get the following warning:
>
> -------------------------------------------------------------------
> bug.cpp: In function `int main(int, char **)':
> bug.cpp:6: warning: decimal integer constant is so large that it is
> unsigned
> -------------------------------------------------------------------
>
> I'm sorry but I don't think that a warning should be issued in this case.
> Could this be resolved in one of the next versions?
>
> If you think that the warning should stay, please write me at:
>
> demuynck@ruca.ua.ac.be
>
> Kris Demuynck.
>