tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Avoiding traditional CPP for assembler



On Fri, Jan 07, 2011 at 09:18:26PM +0000, Christos Zoulas wrote:
> In article <20110107180059.GA28354%britannica.bec.de@localhost>,
> Joerg Sonnenberger  <joerg%britannica.bec.de@localhost> wrote:
> >-=-=-=-=-=-
> >
> >Hi all,
> >the attached patch allows us to slowly move to modern assembler-with-cpp
> >without the legacy -traditional-cpp. The biggest difference is use if of
> >## as string concat and # as stringify as oppossed to /**/ comments and 
> >magic substition inside strings. The patch starts this on i386 and
> >amd64. For amd64 I did a double build of src with and without the patch
> >to check for differences. Other platforms can be converted individually.
> >Comments?
> 
> We could also __CONCAT(,) and __STRING()... but I guess that's ugly.

No, we can't. Nesting macros doesn't work. That's what I was looking at
first, but e.g. the interrupt vectors in x86 are created by macros and
that plays havoc with __CONCAT. It's the reason why so much stuff in
machine/asm.h is duplicated for __STDC__ and !__STDC__.

Joerg


Home | Main Index | Thread Index | Old Index