This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Serious error-causing change in new CPP's -traditional behavior


Sadly, I think -traditional will always be required for processing ARM 
assembler, unless cpp is fixed to not generate an error for the following 
case.
'#' introduces an immediate constant in the assembler syntax; removing it 
is bogus, and worse, there is no way to escape it that I can see, other 
than by playing stupid games.

test.S:
#define foo()   mov     r0, #5
.text
bar:
        foo()

cpp -traditional test.S		OK

# 1 "test.S"

.text
bar:
        mov r0, #5
        mov r0, #5

cpp test.S			NOT OK

# 1 "test.S"
test.S:1:25: # is not followed by a macro argument name

.text
bar:
        mov r0,5
        mov r0,5

Stupid game:
#define HASH #
#define foo()	mov	r0, HASH 5
...

cpp test.S

# 1 "test.S"


.text
bar:
        ldr r0,  # 5
        ldr r0,  # 5



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]