[PATCH] Consider unsigned long for non-u/U decimal literals (C90/C++03)
hubert.reinterpretcast at gmail.com
Thu May 21 14:25:25 PDT 2015
On Fri, May 15, 2015 at 10:31 AM, Hubert Tong <
hubert.reinterpretcast at gmail.com> wrote:
> Hi rsmith, fraggamuffin,
> This modifies Clang to reflect that under pre-C99 ISO C, decimal
> constants may have type `unsigned long` even if they do not contain `u`
> or `U` in their suffix (C90 subclause 184.108.40.206 paragraph 5). The same is
> done for C++ without C++11 which--because of undefined behaviour--allows
> for behaviour compatible with ISO C90 in the case of an unsuffixed
> decimal literal and is otherwise identical to C90 in its treatment of
> integer literals (C++03 subclause 2.13.1 [lex.icon] paragraph 2).
> A message is added alongside `ext_integer_literal_too_large_for_signed`
> to the `implicitly-unsigned-literal` group to warn on this additional
> cause of implicitly unsigned literals.
> Fixes PR 16678.
> EMAIL PREFERENCES
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits