Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sdcsvax.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!greg From: greg@sdcsvax.UUCP Newsgroups: net.bugs.4bsd,net.unix,net.lang.c Subject: Re: Bug in 4.[12] BSD C compiler with "asm" statement Message-ID: <998@sdcsvax.UUCP> Date: Mon, 16-Jul-84 19:38:14 EDT Article-I.D.: sdcsvax.998 Posted: Mon Jul 16 19:38:14 1984 Date-Received: Wed, 18-Jul-84 06:31:47 EDT References: <314@harvard.ARPA> Organization: NCR Corporation, Torrey Pines Lines: 14 The reason that this happens is that the "asm" statement is effectivly processed at the lexical level and just dumped into the output file. It would work correctly if the "asm" statment were turned into a semi-colon, have that processed, and THEN drop it into the output. This is the reason for the common hack to always preceed the "asm" statement by a semi-colon. In fact, if pre-processor substitution worked the way the C standard will have it (where a substituted macro loses its meaning during the evaluation; see the parallel discussion in net.unix-wizards), using #define asm ;asm would cause it to work in all cases -- at least I can't think of any where it wouldn't. -- -- Greg Noel, NCR Torrey Pines Greg@sdcsvax.UUCP or Greg@nosc.ARPA