Subject: Re: Making the (asm) world safe for modern cpp
To: None <>
From: Valeriy E. Ushakov <>
List: tech-toolchain
Date: 09/17/2003 22:32:25
Jim Wise <> wrote:

> One of the main reasons for this behavior is that many of our assembly
> source files use a mix of `/**/'-style and `#'-style comments.  Where
> `#'-style comments appear on a line by themselves, modern cpp is
> confused, while `-traditional-cpp' is not as long as the `#' does not
> appear in the first character position on the line.
> I therefore propose the following sequence of events to eliminate use of
> `-traditional-cpp' in our source tree:

Just a comment: assemblers that use `#' as part of the syntax (not as
a comment starter), e.g. SuperH, will have a problem with dropping

$ /usr/nb3/tools/bin/shle--netbsdelf-gcc-3.3.1 -E -
#define foo mov #0,r0
#define bar(x) mov #0,x
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"

<stdin>:3:21: '#' is not followed by a macro parameter
mov #0,r0


Of course this can be worked around with something like

    #define IMM #
    #define bar(x) mov IMM 0, x 

SY, Uwe
--                         |       Zu Grunde kommen            |       Ist zu Grunde gehen