public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/33466]  New: mixed-case suffix for decimal float constants
@ 2007-09-18  4:01 s__nakayama at infoseek dot jp
  2009-01-31 15:30 ` [Bug c/33466] " tydeman at tybor dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: s__nakayama at infoseek dot jp @ 2007-09-18  4:01 UTC (permalink / raw)
  To: gcc-bugs

GCC accepts mixed-case suffix for decimal float constants.
Mixed-case suffix is not allowed in
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1176.pdf.
Is this a bug or extension?

test case:
double dd = 1.0dD;


-- 
           Summary: mixed-case suffix for decimal float constants
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s__nakayama at infoseek dot jp


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
@ 2009-01-31 15:30 ` tydeman at tybor dot com
  2009-02-02 17:40 ` janis at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tydeman at tybor dot com @ 2009-01-31 15:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tydeman at tybor dot com  2009-01-31 15:29 -------
Problem still exists in gcc 4.3.2-7


-- 

tydeman at tybor dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tydeman at tybor dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
  2009-01-31 15:30 ` [Bug c/33466] " tydeman at tybor dot com
@ 2009-02-02 17:40 ` janis at gcc dot gnu dot org
  2009-02-10 21:50 ` janis at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-02-02 17:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from janis at gcc dot gnu dot org  2009-02-02 17:39 -------
Yes, this is indeed a bug.


-- 

janis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janis at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-02-02 17:39:53
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
  2009-01-31 15:30 ` [Bug c/33466] " tydeman at tybor dot com
  2009-02-02 17:40 ` janis at gcc dot gnu dot org
@ 2009-02-10 21:50 ` janis at gcc dot gnu dot org
  2009-02-11 18:27 ` janis at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-02-10 21:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from janis at gcc dot gnu dot org  2009-02-10 21:50 -------
Suffixes for fixed-point constants are broken as well.  GCC allows the letters
in them to be in any order, except that "ll" must be together and in the same
case.  GCC does not reject 'l' by itself as invalid.  N1169, a draft of TR
18037, says that a suffix is case-insensitive but isn't clear about whether
that means that a suffix can mix cases within a suffix or just that
all-uppercase or all-lowercase varieties are valid.

Function interpret_float_suffix in libcpp/expr.c was originally quite simple. 
It was not designed to support long suffixes like those for decimal-float and
fixed-point constants.  It will need to get even more complicated with support
for suffix 'd' for double contants (PR c/39027) and pragma
FLOAT_CONST_DECIMAL64 (PR c/39037), which specifies whether an unsuffixed float
constant is double or _Decimal64.  I'm looking at reasonable ways to rewrite
it.


-- 

janis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joseph at codesourcery dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (2 preceding siblings ...)
  2009-02-10 21:50 ` janis at gcc dot gnu dot org
@ 2009-02-11 18:27 ` janis at gcc dot gnu dot org
  2009-02-12  2:54 ` tydeman at tybor dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-02-11 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from janis at gcc dot gnu dot org  2009-02-11 18:27 -------
N1169 says that the suffix for a fixed-point literal constant is case
insensitive, which to me means that uhk can be uhK/uHk/uHK/Uhk/UhK/UHk as well
as UHK.  It's easier to implement that way, but if it's really supposed to be a
single case then I'd rather fix that now.

I asked a question about this, and about GCC's use of ll or LL as a length
indicator in fixed-point suffixes, in
http://gcc.gnu.org/ml/gcc/2009-02/msg00191.html but there are people copied on
this PR who probably don't follow that mailing list.  If you're familiar with
the fixed-point TR, please let me know your interpretation of this, or whether
there's a later draft of the TR than N1169.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (3 preceding siblings ...)
  2009-02-11 18:27 ` janis at gcc dot gnu dot org
@ 2009-02-12  2:54 ` tydeman at tybor dot com
  2009-02-23 19:01 ` janis at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tydeman at tybor dot com @ 2009-02-12  2:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tydeman at tybor dot com  2009-02-12 02:54 -------
The latest version of TR 18037 is WG14 document N1275 of 2007/10/01.
The suffix really is case insensitive, so 'uhk' has 8 variations.
'll' and 'LL' are not valid suffixes for fixed point constants.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (4 preceding siblings ...)
  2009-02-12  2:54 ` tydeman at tybor dot com
@ 2009-02-23 19:01 ` janis at gcc dot gnu dot org
  2009-02-23 19:05 ` janis at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-02-23 19:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from janis at gcc dot gnu dot org  2009-02-23 19:00 -------
Subject: Bug 33466

Author: janis
Date: Mon Feb 23 19:00:32 2009
New Revision: 144391

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144391
Log:
        PR c/33466
        * expr.c (interpret_float_suffix): Reject invalid suffix that uses
        letters from decimal float and fixed-point suffixes.

        PR c/33466
        * gcc.dg/cpp/pr33466.c: New test.
        * gcc.dg/dfp/pr33466.c: New test.
        * gcc.dg/fixed-point/pr33466.c: New test.

Added:
    branches/c-4_5-branch/gcc/testsuite/gcc.dg/cpp/pr33466.c
    branches/c-4_5-branch/gcc/testsuite/gcc.dg/dfp/pr33466.c
    branches/c-4_5-branch/gcc/testsuite/gcc.dg/fixed-point/pr33466.c
Modified:
    branches/c-4_5-branch/gcc/testsuite/ChangeLog
    branches/c-4_5-branch/libcpp/ChangeLog
    branches/c-4_5-branch/libcpp/expr.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (5 preceding siblings ...)
  2009-02-23 19:01 ` janis at gcc dot gnu dot org
@ 2009-02-23 19:05 ` janis at gcc dot gnu dot org
  2009-02-23 21:43 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-02-23 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from janis at gcc dot gnu dot org  2009-02-23 19:05 -------
The checkin is for Joseph's c-4.5 branch.  I'll move this to trunk after 4.4
branches.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (6 preceding siblings ...)
  2009-02-23 19:05 ` janis at gcc dot gnu dot org
@ 2009-02-23 21:43 ` joseph at codesourcery dot com
  2009-04-01 17:05 ` janis at gcc dot gnu dot org
  2009-05-04 19:50 ` janis at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: joseph at codesourcery dot com @ 2009-02-23 21:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from joseph at codesourcery dot com  2009-02-23 21:43 -------
Subject: Re:  mixed-case suffix for decimal float constants

On Mon, 23 Feb 2009, janis at gcc dot gnu dot org wrote:

> Modified:
>     branches/c-4_5-branch/gcc/testsuite/ChangeLog
>     branches/c-4_5-branch/libcpp/ChangeLog

You should be using ChangeLog.c45 on the branch, not ChangeLog, to avoid 
gratuitous merge conflicts when I merge from trunk.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (7 preceding siblings ...)
  2009-02-23 21:43 ` joseph at codesourcery dot com
@ 2009-04-01 17:05 ` janis at gcc dot gnu dot org
  2009-05-04 19:50 ` janis at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-04-01 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from janis at gcc dot gnu dot org  2009-04-01 17:05 -------
Subject: Bug 33466

Author: janis
Date: Wed Apr  1 17:04:42 2009
New Revision: 145417

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145417
Log:
libcpp/
        PR c/33466
        * expr.c (interpret_float_suffix): Reject invalid suffix that uses
        letters from decimal float and fixed-point suffixes.

gcc/testsuite
        PR c/33466
        * gcc.dg/cpp/pr33466.c: New test.
        * gcc.dg/dfp/pr33466.c: New test.
        * gcc.dg/fixed-point/pr33466.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/pr33466.c
    trunk/gcc/testsuite/gcc.dg/dfp/pr33466.c
    trunk/gcc/testsuite/gcc.dg/fixed-point/pr33466.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/expr.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/33466] mixed-case suffix for decimal float constants
  2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
                   ` (8 preceding siblings ...)
  2009-04-01 17:05 ` janis at gcc dot gnu dot org
@ 2009-05-04 19:50 ` janis at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-05-04 19:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from janis at gcc dot gnu dot org  2009-05-04 19:50 -------
Fixed for trunk, expected to become GCC 4.5.0.


-- 

janis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33466


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-05-04 19:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-18  4:01 [Bug c/33466] New: mixed-case suffix for decimal float constants s__nakayama at infoseek dot jp
2009-01-31 15:30 ` [Bug c/33466] " tydeman at tybor dot com
2009-02-02 17:40 ` janis at gcc dot gnu dot org
2009-02-10 21:50 ` janis at gcc dot gnu dot org
2009-02-11 18:27 ` janis at gcc dot gnu dot org
2009-02-12  2:54 ` tydeman at tybor dot com
2009-02-23 19:01 ` janis at gcc dot gnu dot org
2009-02-23 19:05 ` janis at gcc dot gnu dot org
2009-02-23 21:43 ` joseph at codesourcery dot com
2009-04-01 17:05 ` janis at gcc dot gnu dot org
2009-05-04 19:50 ` janis at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).