diff options
author | janis <> | 2007-05-14 22:45:40 +0000 |
---|---|---|
committer | janis <> | 2007-05-14 22:45:40 +0000 |
commit | c628c1aae3e4fb8864f27a12932995a5e7ddd0b2 (patch) | |
tree | df0bccc33a1c52f690ba0aed1805effa9212b0ad /libcpp | |
parent | fc4b3d5e7fe30a1f9e0e25596a7ae902ae63905f (diff) |
libcpp/
* expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
gcc/testsuite/
* gcc.dg/fltconst-pedantic-dfp.c: New test.
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 2 | ||||
-rw-r--r-- | libcpp/expr.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 5b941ff9cca..31d96e8b684 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,5 +1,7 @@ 2007-05-14 Janis Johnson <janis187@us.ibm.com> + * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic. + PR c/31924 * expr.c (interpret_float_suffix): Check for invalid suffix. diff --git a/libcpp/expr.c b/libcpp/expr.c index 8401daee032..20090195acc 100644 --- a/libcpp/expr.c +++ b/libcpp/expr.c @@ -273,6 +273,10 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) return CPP_N_INVALID; } + if ((result & CPP_N_DFLOAT) && CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_PEDWARN, + "decimal float constants are a GCC extension"); + result |= CPP_N_FLOATING; } else |