mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-23 03:19:09 +08:00
c-lex.c (yylex): With -Wtraditional...
* c-lex.c (yylex): With -Wtraditional, when the ANSI type of an integer constant does not match the traditional type, limit the warnings to cases where the base of the type is ten. * invoke.texi (-Wtraditional): Document it. From-SVN: r30730
This commit is contained in:
parent
481c7efae8
commit
48776cde06
@ -1,3 +1,11 @@
|
|||||||
|
1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* c-lex.c (yylex): With -Wtraditional, when the ANSI type of an
|
||||||
|
integer constant does not match the traditional type, limit the
|
||||||
|
warnings to cases where the base of the type is ten.
|
||||||
|
|
||||||
|
* invoke.texi (-Wtraditional): Document it.
|
||||||
|
|
||||||
Tue Nov 30 15:18:35 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
Tue Nov 30 15:18:35 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
||||||
|
|
||||||
* combine.c (try_combine): Only pass SET or CLOBBER to SET_DEST
|
* combine.c (try_combine): Only pass SET or CLOBBER to SET_DEST
|
||||||
|
@ -1901,7 +1901,11 @@ yylex ()
|
|||||||
|
|
||||||
type = flag_traditional ? traditional_type : ansi_type;
|
type = flag_traditional ? traditional_type : ansi_type;
|
||||||
|
|
||||||
if (warn_traditional && traditional_type != ansi_type)
|
/* We assume that constants specified in a non-decimal
|
||||||
|
base are bit patterns, and that the programmer really
|
||||||
|
meant what they wrote. */
|
||||||
|
if (warn_traditional && base == 10
|
||||||
|
&& traditional_type != ansi_type)
|
||||||
{
|
{
|
||||||
if (TYPE_PRECISION (traditional_type)
|
if (TYPE_PRECISION (traditional_type)
|
||||||
!= TYPE_PRECISION (ansi_type))
|
!= TYPE_PRECISION (ansi_type))
|
||||||
|
@ -1692,6 +1692,12 @@ A @code{switch} statement has an operand of type @code{long}.
|
|||||||
@item
|
@item
|
||||||
A non-@code{static} function declaration follows a @code{static} one.
|
A non-@code{static} function declaration follows a @code{static} one.
|
||||||
This construct is not accepted by some traditional C compilers.
|
This construct is not accepted by some traditional C compilers.
|
||||||
|
|
||||||
|
@item
|
||||||
|
The ANSI type of an integer constant has a different width or
|
||||||
|
signedness from its traditional type. This warning is only issued if
|
||||||
|
the base of the constant is ten. I.e. hexadecimal or octal values, which
|
||||||
|
typically represent bit patterns, are not warned about.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@item -Wundef
|
@item -Wundef
|
||||||
|
Loading…
Reference in New Issue
Block a user