This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: the standard rules for assigning types to integer constants inC
- To: Zack Weinberg <zackw at panix dot com>
- Subject: Re: the standard rules for assigning types to integer constants inC
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Wed, 22 Aug 2001 18:37:34 +0100 (BST)
- cc: <gcc at gcc dot gnu dot org>
On Tue, 21 Aug 2001, Zack Weinberg wrote:
> 1: Were these rules different in C89? If so, what were they?
They were different in C89:
The type of an integer constant is the first of the corresponding
list in which its value can be represented. Unsuffixed decimal:
int, long int, unsigned long int; unsuffixed octal or hexadecimal:
int, unsigned int, long int, unsigned long int; suffixed by the
letter u or U: unsigned int, unsigned long int; suffixed by the
letter l or L: long int, unsigned long int; suffixed by both the
letters u or U and l or L: unsigned long int.
> 2: What, if anything, should we do about this?
Implement the rules conditional on flag_isoc99 (making sure that something
appropriate and consistent with ISO 14882 is done for C++) and change
"integer constant type rules" in c99status.html from "Missing" to "Done".
Work out what -Wtraditional ought to do in C99 mode if the C99 type is the
same as the traditional type but different from the C89 type. No-one
answered my question <URL:http://gcc.gnu.org/ml/gcc/2000-09/msg00417.html>
about this, so I left off implementing this feature.
--
Joseph S. Myers
jsm28@cam.ac.uk