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

Reply via email to