[Bug c/86720] New: Missing symbol name in directive

zhonghao at pku dot org.cn gcc-bugzilla@gcc.gnu.org
Sun Jul 29 08:46:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86720

            Bug ID: 86720
           Summary: Missing symbol name in directive
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

The code is as follow:

unsigned char foo (unsigned char x)
{
 static volatile unsigned char P1OUT __asm ("0x0021");
 unsigned char tmp = P1OUT;
 P1OUT = x;
 return tmp;
}

clang accepts the code. gcc rejects it with some strange messages:

gcc -c test.c 
/tmp/ccOWvef3.s: Assembler messages:
/tmp/ccOWvef3.s:26: Error: Missing symbol name in directive
/tmp/ccOWvef3.s:26: Error: junk at end of line, first unrecognized character is
`0'
/tmp/ccOWvef3.s:27: Error: expected symbol name

Even if the code is illegal, please refine the error messages.


More information about the Gcc-bugs mailing list