public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/41610]  New: Non-standard identifier's names
@ 2009-10-06 17:28 hudson at comp dot ufla dot br
  2009-10-07  9:29 ` [Bug c/41610] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hudson at comp dot ufla dot br @ 2009-10-06 17:28 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

Hi,

I compiled the follow program:

1 int main()
2 {
3     int $my_int_var;
4     my_int_var = 9;
5     return 0;
6 }

using this command-line:

gcc -ansi -Wall -o identifier identifier.c

I made two tests: first, without line 4. That's ok! It recognized token
$my_int_var as a valid identifier. But ANSI C say that identifiers must starts
with letter or underscore, and so on, letter, underscore or digit.

After, I inserted the line 4 and I got the error (my program is identifier.c):

identifier.c: In function ‘main’:
identifier.c:4: error: ‘my_int_var’ undeclared (first use in this function)
identifier.c:4: error: (Each undeclared identifier is reported only once
identifier.c:4: error: for each function it appears in.)
identifier.c:3: warning: unused variable ‘$my_int_var’

I mean, it accepted $my_int_var as valid identifier, but don't my_int_var (not
declared). There wasn't warnings/errors about this.

I used versions 4.2.4 and 4.3.2.

Bye!


-- 
           Summary: Non-standard identifier's names
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hudson at comp dot ufla dot br


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


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

* [Bug c/41610] Non-standard identifier's names
  2009-10-06 17:28 [Bug c/41610] New: Non-standard identifier's names hudson at comp dot ufla dot br
@ 2009-10-07  9:29 ` rguenth at gcc dot gnu dot org
  2009-10-07 13:47 ` hudson at comp dot ufla dot br
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-07  9:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-07 09:29 -------
Huh?  You just cited the errors you got.  Use -pedantic if you want to be
warned about $ in identifiers.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME


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


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

* [Bug c/41610] Non-standard identifier's names
  2009-10-06 17:28 [Bug c/41610] New: Non-standard identifier's names hudson at comp dot ufla dot br
  2009-10-07  9:29 ` [Bug c/41610] " rguenth at gcc dot gnu dot org
@ 2009-10-07 13:47 ` hudson at comp dot ufla dot br
  2009-10-07 13:58 ` jakub at gcc dot gnu dot org
  2009-10-07 16:23 ` hudson at comp dot ufla dot br
  3 siblings, 0 replies; 5+ messages in thread
From: hudson at comp dot ufla dot br @ 2009-10-07 13:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hudson at comp dot ufla dot br  2009-10-07 13:47 -------
Ok, but this isn't a warning, it's an *error*. Concordant to specification
ANSI, it's not acceptable. Even -pedantic option must to give an error, no?

Anyway, thanks by reply!


-- 


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


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

* [Bug c/41610] Non-standard identifier's names
  2009-10-06 17:28 [Bug c/41610] New: Non-standard identifier's names hudson at comp dot ufla dot br
  2009-10-07  9:29 ` [Bug c/41610] " rguenth at gcc dot gnu dot org
  2009-10-07 13:47 ` hudson at comp dot ufla dot br
@ 2009-10-07 13:58 ` jakub at gcc dot gnu dot org
  2009-10-07 16:23 ` hudson at comp dot ufla dot br
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-10-07 13:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2009-10-07 13:58 -------
You are looking for -pedantic-errors I guess.


-- 


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


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

* [Bug c/41610] Non-standard identifier's names
  2009-10-06 17:28 [Bug c/41610] New: Non-standard identifier's names hudson at comp dot ufla dot br
                   ` (2 preceding siblings ...)
  2009-10-07 13:58 ` jakub at gcc dot gnu dot org
@ 2009-10-07 16:23 ` hudson at comp dot ufla dot br
  3 siblings, 0 replies; 5+ messages in thread
From: hudson at comp dot ufla dot br @ 2009-10-07 16:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hudson at comp dot ufla dot br  2009-10-07 16:23 -------
Oh, yeah! I'm sorry!

I'll take care in the next time...
Thanks a lot!


-- 


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


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

end of thread, other threads:[~2009-10-07 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-06 17:28 [Bug c/41610] New: Non-standard identifier's names hudson at comp dot ufla dot br
2009-10-07  9:29 ` [Bug c/41610] " rguenth at gcc dot gnu dot org
2009-10-07 13:47 ` hudson at comp dot ufla dot br
2009-10-07 13:58 ` jakub at gcc dot gnu dot org
2009-10-07 16:23 ` hudson at comp dot ufla dot br

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