Date: Tue, 13 Aug 1996 11:57:32 -0400 From: Alexander Seth Jones <ajones@ctron.com> To: hackers@freefall.freebsd.org Subject: <machine/spl.h> and C++ Message-ID: <3210A5EC.60B5@ctron.com>
next in thread | raw e-mail | index | archive | help
Hello,
I'm writing a device driver in C++, and have run into a problem with
the GENSPL macro in <machine/spl.h>. g++ is croaking on the statement:
__asm __volatile("":::"memory");
with the following error:
parse error before "::"
Without getting into an argument about whether g++ is in error about
accepting the code as it is, I'm asking whether or not this code
fragment even needs to exist.
Now, I just tried an interesting experiment. I generated the assembly
code (using init_main.c) with the asm declaration in there. It produced
#APP
#NO_APP
where the asm declaration should be. Then I generated the assembly with
the asm declaration removed, and the code was the exact same except the
#APP/#NO_APP code was gone. gas also says:
If the first line of an input file is `#NO_APP' or if you use the
`-f' option, whitespace and comments are not removed from the input
file. Within an input file, you can ask for whitespace and comment
removal in specific portions of the by putting a line that says `#APP'
before the text that may contain whitespace or comments, and putting a
line that says `#NO_APP' after this text. This feature is mainly
intend to support `asm' statements in compilers whose output is
otherwise free of comments and whitespace.
So it seems like the asm statement is a no-op. Is this a fair
assumption? Can I just safely get rid of it? What are people's
thoughts about this?
--
Alex Jones | ajones@ctron.com
Cabletron Systems, Inc.
Durham, NH USA 03824
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3210A5EC.60B5>
