public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/9209: cc allows dollars in identifiers by default on i386 but fails
@ 2003-01-06 23:06 121269
  0 siblings, 0 replies; 2+ messages in thread
From: 121269 @ 2003-01-06 23:06 UTC (permalink / raw)
  To: gcc-gnats; +Cc: Bill Allombert


>Number:         9209
>Category:       c
>Synopsis:       cc allows dollars in identifiers by default on i386 but fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 06 15:06:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     121269@bugs.debian.org
>Release:        gcc-3.3 branch 20021231
>Organization:
>Environment:
i386-linux
>Description:
[ Reported to the Debian BTS as report #121269. 
  Please CC 121269@bugs.debian.org on replies. 
  Log of report can be found at http://bugs.debian.org/121269 ] 
 
this changed from gcc-2.95 to gcc-3.x. Even when using -Wall, -fno-dollars-in-identifiers doesn't warn about dollars in identifiers and does not give any error messages. 

$ gcc-2.95 -fno-dollars-in-identifiers bug-121269.c    
bug-121269.c:1: `$' in identifier   
bug-121269.c: In function `main':   
bug-121269.c:4: `$' in identifier   
bug-121269.c:4: `$' in identifier   
bug-121269.c:4: `$' in identifier   
bug-121269.c:6: `$' in identifier   
   
$ gcc-3.2 -fno-dollars-in-identifiers bug-121269.c    
/tmp/ccpP3lr8.s: Assembler messages:   
/tmp/ccpP3lr8.s:15: Error: suffix or operands invalid for `mov'   
/tmp/ccpP3lr8.s:17: Error: suffix or operands invalid for `cmp'   
/tmp/ccpP3lr8.s:26: Error: suffix or operands invalid for `inc'   
   
-------------   
int $b;   
main()   
{   
  for($b=0;$b<10;$b++)   
  {   
    printf("%d\n",$b);   
  }   
}   
-------------   
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c/9209: cc allows dollars in identifiers by default on i386 but fails
@ 2003-01-07  0:43 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-01-07  0:43 UTC (permalink / raw)
  To: 121269, ballombe, gcc-bugs, gcc-prs, nobody

Synopsis: cc allows dollars in identifiers by default on i386 but fails

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Jan  6 16:43:21 2003
State-Changed-Why:
    Confirmed.
    
    There are several things that are wrong:
    - The warning has no effect, i.e. it does not warn when
      dollars _are_ in identifiers.
    - C++ and ISO C do not allow dollars in identifiers. And
      they say so: compiling with -std=c99 and without the
      flag in question yields errors
    - The documentation says that this is a flag that controls
      the _C++_ dialect, yet it is accepted by the C front end
      as well
    - The documentation states:
    `-fdollars-in-identifiers'
         Accept `$' in identifiers.  You can also explicitly prohibit use of
         `$' with the option `-fno-dollars-in-identifiers'.  (GNU C allows
         `$' by default on most target systems, but there are a few
         exceptions.)  Traditional C allowed the character `$' to form part
         of identifiers.  However, ISO C and C++ forbid `$' in identifiers.
    
      Linux alone certainly does not mean "most", but it is an
      important system and if it does not work there, the 
      sentence about "most systems" might mislead about the
      portability of code that uses dollars in identifiers.
    
    That being said, my opinion clearly is: just don't do it :-)
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9209


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

end of thread, other threads:[~2003-01-07  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-06 23:06 c/9209: cc allows dollars in identifiers by default on i386 but fails 121269
2003-01-07  0:43 bangerth

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).