[comp.lang.c++] volatile in cfront 2.0

philip@pescadero.Stanford.EDU (Philip Machanick) (09/07/90)

I am attempting to port C++ 2.0 (using AT&T source code) to a machine
which uses the "volatile" type specifier in its C header files. Cfront
2.0 strips out volatile in the mangled C output, and gives the message

warning: " volatile" not implemented (ignored)

I can think of 2 possibilities here:

1. filter the headers before and after cfront, e.g., convert all "volatile"
   to /*volatile*/, then back
2. find the place in the source where volatile is stripped and change it

1 is less than ideal because it would break if the word "volatile" appeared
in a comment (though I suppose I could work out a safer transformation..).
2 might break in some declarations that don't translate directly into
simple C. For that matter, why _is_ volatile not implemented?

Any comments or suggestions would be welcome.

Philip Machanick
philip@pescadero.stanford.edu

rfg@NCD.COM (Ron Guilmette) (09/08/90)

In article <1990Sep6.214428.18551@Neon.Stanford.EDU> philip@pescadero.stanford.edu writes:
>I am attempting to port C++ 2.0 (using AT&T source code) to a machine
>which uses the "volatile" type specifier in its C header files. Cfront
>2.0 strips out volatile in the mangled C output, and gives the message
>
>warning: " volatile" not implemented (ignored)
>
>I can think of 2 possibilities here:
>
>1. filter the headers before and after cfront, e.g., convert all "volatile"
>   to /*volatile*/, then back
>2. find the place in the source where volatile is stripped and change it

Option #3:

	Add the following to your $(CFLAGS) in your Makefile(s):

		-Dvolatile=""

>... For that matter, why _is_ volatile not implemented?

The usual reasons.  Time and money. :-)

P.S.  Note that the `signed' keyword is unappreciated by cfront 2.0 also.

-- 

// Ron Guilmette  -  C++ Entomologist
// Internet: rfg@ncd.com      uucp: ...uunet!lupine!rfg
// Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.