public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/24976]  New: simple hexadecimal number parsed as C99 hex float
@ 2005-11-21 17:24 bernie at develer dot com
  2005-11-21 17:28 ` [Bug preprocessor/24976] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: bernie at develer dot com @ 2005-11-21 17:24 UTC (permalink / raw)
  To: gcc-bugs

This testcase:

  int a = 0xe+100;

Produces a diagnostic message that would surprise
most users:

 foo.c:1:9: error: invalid suffix "+100" on integer constant


I'm not sure what the standard says about ambiguity
between the hex float notation and the regular + operator,
but many users are going to think of this behavior as
a parser bug.


-- 
           Summary: simple hexadecimal number parsed as C99 hex float
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bernie at develer dot com


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


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

* [Bug preprocessor/24976] simple hexadecimal number parsed as C99 hex float
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
@ 2005-11-21 17:28 ` pinskia at gcc dot gnu dot org
  2005-11-21 18:21 ` joseph at codesourcery dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-21 17:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-21 17:28 -------
(In reply to comment #0)
> but many users are going to think of this behavior as
> a parser bug.

This is more of a tokenizer error rather than a parser error.

Anyways 2.95.3 gives:
t.c:1: missing white space after number `0xe'

I wonder if we should accept this code for -std=c89.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |preprocessor


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


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

* [Bug preprocessor/24976] simple hexadecimal number parsed as C99 hex float
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
  2005-11-21 17:28 ` [Bug preprocessor/24976] " pinskia at gcc dot gnu dot org
@ 2005-11-21 18:21 ` joseph at codesourcery dot com
  2005-11-21 18:41 ` bernie at develer dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: joseph at codesourcery dot com @ 2005-11-21 18:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from joseph at codesourcery dot com  2005-11-21 18:21 -------
Subject: Re:   New: simple hexadecimal number parsed as C99 hex
 float

On Mon, 21 Nov 2005, bernie at develer dot com wrote:

> This testcase:
> 
>   int a = 0xe+100;

0xe+100 is a single preprocessing number.  If the end of 
<http://gcc.gnu.org/onlinedocs/gcc/Incompatibilities.html> is unclear, 
please let us know how we could have improved it so that you would have 
realised it applies to this situation and so there is no bug.


-- 


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


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

* [Bug preprocessor/24976] simple hexadecimal number parsed as C99 hex float
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
  2005-11-21 17:28 ` [Bug preprocessor/24976] " pinskia at gcc dot gnu dot org
  2005-11-21 18:21 ` joseph at codesourcery dot com
@ 2005-11-21 18:41 ` bernie at develer dot com
  2005-11-21 22:27 ` [Bug preprocessor/24976] [3.4/4.0/4.1/4.2 Regression] simple hexadecimal number and plus/minus and no space pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bernie at develer dot com @ 2005-11-21 18:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bernie at develer dot com  2005-11-21 18:41 -------
(In reply to comment #2)

> 0xe+100 is a single preprocessing number.  If the end of 
> <http://gcc.gnu.org/onlinedocs/gcc/Incompatibilities.html> is unclear, 
> please let us know how we could have improved it so that you would have 
> realised it applies to this situation and so there is no bug.

We could handle it like we do for >> in nested template
declarations: split the token and try reparsing the
expression with the "other" meaning.  If it works, give
the friendly error message ("maybe you meant 0xe + 100?").


-- 


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


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

* [Bug preprocessor/24976] [3.4/4.0/4.1/4.2 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (2 preceding siblings ...)
  2005-11-21 18:41 ` bernie at develer dot com
@ 2005-11-21 22:27 ` pinskia at gcc dot gnu dot org
  2005-12-19 18:07 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-21 22:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2005-11-21 22:27 -------
Confirmed, as a diagnostic issue only.  I am going to mark this as a regression
even though I know that the preprocessor was rewritten between 2.95.3 and
3.0.x.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|rejects-valid               |diagnostic
      Known to fail|                            |3.0.4
      Known to work|                            |2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-21 22:27:09
               date|                            |
            Summary|simple hexadecimal number   |[3.4/4.0/4.1/4.2 Regression]
                   |parsed as C99 hex float     |simple hexadecimal number
                   |                            |and plus/minus and no space
   Target Milestone|---                         |4.0.3


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


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

* [Bug preprocessor/24976] [3.4/4.0/4.1/4.2 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (3 preceding siblings ...)
  2005-11-21 22:27 ` [Bug preprocessor/24976] [3.4/4.0/4.1/4.2 Regression] simple hexadecimal number and plus/minus and no space pinskia at gcc dot gnu dot org
@ 2005-12-19 18:07 ` mmitchel at gcc dot gnu dot org
  2006-03-11  3:22 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-12-19 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2005-12-19 18:07 -------
Downgraded to P5, as this will never be a release-critical issue.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


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


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

* [Bug preprocessor/24976] [3.4/4.0/4.1/4.2 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (4 preceding siblings ...)
  2005-12-19 18:07 ` mmitchel at gcc dot gnu dot org
@ 2006-03-11  3:22 ` mmitchel at gcc dot gnu dot org
  2007-02-03 16:03 ` [Bug preprocessor/24976] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:22 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.0.4


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


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

* [Bug preprocessor/24976] [4.0/4.1/4.2/4.3 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (5 preceding siblings ...)
  2006-03-11  3:22 ` mmitchel at gcc dot gnu dot org
@ 2007-02-03 16:03 ` gdr at gcc dot gnu dot org
  2007-02-03 17:26 ` jsm28 at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from gdr at gcc dot gnu dot org  2007-02-03 16:03 -------
Won't fix in GCC-4.0.x.  Adjusting milestone.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.4                       |---


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


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

* [Bug preprocessor/24976] [4.0/4.1/4.2/4.3 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (6 preceding siblings ...)
  2007-02-03 16:03 ` [Bug preprocessor/24976] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
@ 2007-02-03 17:26 ` jsm28 at gcc dot gnu dot org
  2007-02-14  9:37 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-02-03 17:26 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


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


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

* [Bug preprocessor/24976] [4.0/4.1/4.2/4.3 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (7 preceding siblings ...)
  2007-02-03 17:26 ` jsm28 at gcc dot gnu dot org
@ 2007-02-14  9:37 ` mmitchel at gcc dot gnu dot org
  2008-07-04 20:15 ` [Bug preprocessor/24976] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


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

* [Bug preprocessor/24976] [4.2/4.3/4.4 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (8 preceding siblings ...)
  2007-02-14  9:37 ` mmitchel at gcc dot gnu dot org
@ 2008-07-04 20:15 ` jsm28 at gcc dot gnu dot org
  2009-03-31 19:02 ` [Bug preprocessor/24976] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 20:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2008-07-04 20:14 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3/4.4 Regression]|[4.2/4.3/4.4 Regression]
                   |simple hexadecimal number   |simple hexadecimal number
                   |and plus/minus and no space |and plus/minus and no space
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug preprocessor/24976] [4.3/4.4/4.5 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (9 preceding siblings ...)
  2008-07-04 20:15 ` [Bug preprocessor/24976] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2009-03-31 19:02 ` jsm28 at gcc dot gnu dot org
  2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:16 ` [Bug preprocessor/24976] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 19:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jsm28 at gcc dot gnu dot org  2009-03-31 19:01 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3/4.4/4.5 Regression]|[4.3/4.4/4.5 Regression]
                   |simple hexadecimal number   |simple hexadecimal number
                   |and plus/minus and no space |and plus/minus and no space
   Target Milestone|4.2.5                       |4.3.4


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


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

* [Bug preprocessor/24976] [4.3/4.4/4.5 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (10 preceding siblings ...)
  2009-03-31 19:02 ` [Bug preprocessor/24976] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:16 ` [Bug preprocessor/24976] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2009-08-04 12:27 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


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

* [Bug preprocessor/24976] [4.3/4.4/4.5/4.6 Regression] simple hexadecimal number and plus/minus and no space
  2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
                   ` (11 preceding siblings ...)
  2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:16 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2010-05-22 18:10 -------
GCC 4.3.5 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.6


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


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

end of thread, other threads:[~2010-05-22 18:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 17:24 [Bug c/24976] New: simple hexadecimal number parsed as C99 hex float bernie at develer dot com
2005-11-21 17:28 ` [Bug preprocessor/24976] " pinskia at gcc dot gnu dot org
2005-11-21 18:21 ` joseph at codesourcery dot com
2005-11-21 18:41 ` bernie at develer dot com
2005-11-21 22:27 ` [Bug preprocessor/24976] [3.4/4.0/4.1/4.2 Regression] simple hexadecimal number and plus/minus and no space pinskia at gcc dot gnu dot org
2005-12-19 18:07 ` mmitchel at gcc dot gnu dot org
2006-03-11  3:22 ` mmitchel at gcc dot gnu dot org
2007-02-03 16:03 ` [Bug preprocessor/24976] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
2007-02-03 17:26 ` jsm28 at gcc dot gnu dot org
2007-02-14  9:37 ` mmitchel at gcc dot gnu dot org
2008-07-04 20:15 ` [Bug preprocessor/24976] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-03-31 19:02 ` [Bug preprocessor/24976] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
2010-05-22 18:16 ` [Bug preprocessor/24976] [4.3/4.4/4.5/4.6 " rguenth 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).