Specifying -std=c99 does not define __ASSEMBLER__ for assembler with
preprocessor inputfile (.S):

$ cat x.S 
#ifndef __ASSEMBLER__
extern int func(void);
#else
.global func
.type func,%function
.align 4
func:
        ret
.size func,.-func
#endif
$ gcc -c x.S -o x.o 
$ gcc -c x.S -o x.o -std=c99
x.S: Assembler messages:
x.S:2: Error: no such instruction: `extern int func(void)'
$ gcc -std=c99 -x assembler-with-cpp -c x.S -o x.o
x.S: Assembler messages:
x.S:2: Error: no such instruction: `extern int func(void)'
$

I'd expect that __ASSEMBLER__ is defined even when any -std= was given.


-- 
           Summary: -std= produces incorrect preprocessor output for .S
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aldot at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


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

Reply via email to