From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23893 invoked by alias); 26 Mar 2009 01:33:36 -0000 Received: (qmail 23870 invoked by uid 48); 26 Mar 2009 01:33:24 -0000 Date: Thu, 26 Mar 2009 01:33:00 -0000 Subject: [Bug preprocessor/39559] New: constants too large for intmax_t need pedwarns X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jsm28 at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-03/txt/msg01790.txt.bz2 unsigned long long l = 9223372036854775808LL; should get an error with -std=c99 -pedantic-errors, but instead gets a warning: t.c:1:24: warning: integer constant is so large that it is unsigned C99 does not allow decimal constants without "U" suffix to get an unsigned type. I think the preprocessor should pedwarn in this case (for C99, not C90), to catch the use of such constants in #if conditions as well. The preprocessor already pedwarns for a value large enough to be outside the range of uintmax_t (which is used to set the preprocessor's internal precision), so I believe this case of a constant inside the range of uintmax_t but outside that of intmax_t, in decimal without "U" suffix, is the only current case of this bug. See for some historical discussion (but it doesn't appear types wider than intmax_t can ever appear this way after all). -- Summary: constants too large for intmax_t need pedwarns Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsm28 at gcc dot gnu dot org OtherBugsDependingO 16989 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39559