diff options
author | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-01 17:31:26 +0000 |
---|---|---|
committer | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-01 17:31:26 +0000 |
commit | f8ed6d41439b594e4be05b47b2999a45b0c4fecb (patch) | |
tree | 6d2eb69c07acf9dfdd9f7f3af93d923a035bc1f3 /gcc/c-lex.c | |
parent | 098581e0aac4ee21dcaf02bb2bcb509cd10f655a (diff) | |
download | gcc-f8ed6d41439b594e4be05b47b2999a45b0c4fecb.tar.gz |
gcc/
PR c/29027
* c-lex.c (interpret_float): Default (no suffix) is double.
libcpp/
PR c/29027
* include/cpplib.h (CPP_N_DEFAULT): Define.
* expr.c (interpret_float_suffix): Recognize d or D for double,
return new value for default.
(cpp_classify_number): Issue pedwarn for use of d or D in suffix.
gcc/testsuite/
PR c/29027
* gcc.dg/fltconst-1.c: Don't error for use of d or D in suffix.
* gcc.dg/fltconst-2.c: New test.
* gcc.dg/fltconst-double-pedantic-1.c: New test.
* gcc.dg/fltconst-double-pedantic-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 72a959052d2..9fe29df15fb 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -612,6 +612,13 @@ interpret_float (const cpp_token *token, unsigned int flags) char *copy; size_t copylen; + /* Default (no suffix) is double. */ + if (flags & CPP_N_DEFAULT) + { + flags ^= CPP_N_DEFAULT; + flags |= CPP_N_MEDIUM; + } + /* Decode _Fract and _Accum. */ if (flags & CPP_N_FRACT || flags & CPP_N_ACCUM) return interpret_fixed (token, flags); |