Subject: Making the (asm) world safe for modern cpp
To: None <tech-toolchain@netbsd.org>
From: Jim Wise <jwise@draga.com>
List: tech-toolchain
Date: 09/17/2003 14:02:18
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Currently, asm sources which are processed with cpp (.S) files are run
through `-traditional-cpp', rather than modern cpp. This should change,
as `-traditional-cpp' will _eventually_ go away, and as it leads to
subtle differences in macro expansion between c and assembly source
files.
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:
a.) I will modify all .S assembly source files to consistently use
`/**/'-style comments.
b.) When this is done, rendering the tree buildable without `cpp
-traditional', I will issue a warning that portmasters should check
their ports for any hidden dependencies on traditional cpp behavior
in assembly sources. Such dependencies would need to be removed in
_any_ case, as they lead to counter-intuitive and hard-to-debug
situations.
c.) a week later, I will modify src/share/mk/bsd.dep.mk to eliminate use
of the `-traditional-cpp' flag when preprocessing .S assembly source
files.
Any Comments? Proposed improvements? Objections?
Barring the latter, I will do this work this weekend, three-to-four days
from now.
- --
Jim Wise
jwise@draga.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQE/aKGtRxzMSZ/9vAMRAs/AAJ4hkrEyLRlTxsv15vWdPXB/sevoMQCgjgTB
Nrs46nOupg/rzm1qRz7EI00=
=H/wh
-----END PGP SIGNATURE-----