Qualifier "volatile" - probably OT.

C

Charles Sullivan

On my system (using gcc) I found I need to use the "volatile"
qualifier to limit compiler optimization. I notice that this
qualifier is described in K&R 2nd edition (1988) but not in
K&R 1st edition (1978).

Are there realistically any major C compilers in use today that
don't recognize this qualifier?

Thanks for your help and forbearance.

Regards,
Charles Sullivan
 
K

Keith Thompson

Charles Sullivan said:
On my system (using gcc) I found I need to use the "volatile"
qualifier to limit compiler optimization. I notice that this
qualifier is described in K&R 2nd edition (1988) but not in
K&R 1st edition (1978).

Are there realistically any major C compilers in use today that
don't recognize this qualifier?

Probably not. At this point, it's probably safe to assume that any C
compiler supports at least the entire C90 standard -- unless you have
a requirement to support very old platforms. You'll still see a fair
amount of code that includes preprocessor tricks to cater to compilers
that don't support function prototypes, but it's probably no longer
necessary. (Even gcc, I believe, no longer supports pre-ANSI hosting
compilers.)
 
C

Christopher Benson-Manica

Charles Sullivan said:
Are there realistically any major C compilers in use today that
don't recognize this qualifier?

As it is part of the standard, a compiler that does not recognize it
is not strictly a C compiler. Practically, it means that most
anything claiming to be a C compiler these days will support it, with
the possible exception of compilers targetting outdated (or not)
embedded platforms.
 
C

Charles Sullivan

As it is part of the standard, a compiler that does not recognize it
is not strictly a C compiler. Practically, it means that most
anything claiming to be a C compiler these days will support it, with
the possible exception of compilers targetting outdated (or not)
embedded platforms.

Thanks Christopher and Keith, your responses were most
appreciated.

Regards,
Charles Sullivan
 
J

Jordan Abel

Probably not. At this point, it's probably safe to assume that any C
compiler supports at least the entire C90 standard -- unless you have
a requirement to support very old platforms. You'll still see a fair
amount of code that includes preprocessor tricks to cater to compilers
that don't support function prototypes, but it's probably no longer
necessary. (Even gcc, I believe, no longer supports pre-ANSI hosting
compilers.)

You sure? gcc's a special case, since there's a semi-legitimate need to
compile gcc [an ansi compiler] on a non-ansi system - Is there at least
somewhere one can "build the tools to build the tools" to make gcc, so
to speak, on such platforms?
 
K

Keith Thompson

Jordan Abel said:
Probably not. At this point, it's probably safe to assume that any C
compiler supports at least the entire C90 standard -- unless you have
a requirement to support very old platforms. You'll still see a fair
amount of code that includes preprocessor tricks to cater to compilers
that don't support function prototypes, but it's probably no longer
necessary. (Even gcc, I believe, no longer supports pre-ANSI hosting
compilers.)

You sure? gcc's a special case, since there's a semi-legitimate need to
compile gcc [an ansi compiler] on a non-ansi system - Is there at least
somewhere one can "build the tools to build the tools" to make gcc, so
to speak, on such platforms?

I'm not 100% sure, but I remember reading about it. Older versions of
gcc are still available; if necessary, you can always use a native
pre-ANSI compiler to bootstrap an older gcc, then use the resulting
gcc to bootstrap the most current one.
 
M

Michael Wojcik

Probably not. At this point, it's probably safe to assume that any C
compiler supports at least the entire C90 standard -- unless you have
a requirement to support very old platforms. You'll still see a fair
amount of code that includes preprocessor tricks to cater to compilers
that don't support function prototypes, but it's probably no longer
necessary.

That's probably true for most C developers - I certainly hope that it
is, anyway. But we're still supporting some products in some pre-
standard implementations, due to contractual obligations. (I think
Sinix is one platform where we're still constrained to a pre-standard
implementation.) So there are still some commercial C products being
actively maintained for pre-C90 implementations.

Fortunately, that seems to be quite rare, and I agree with Keith that
it seems to be safe to assume at least C90 as a default.

(I can't wait for the day when we can get rid of those platforms.
However, I see postings from people on comp.lang.cobol who can't use
the 1985 COBOL yet, so they've had four more years of pain. Man with
no feet and all that.)

--
Michael Wojcik (e-mail address removed)

Reversible CA's are -automorphisms- on shift spaces. It is a notorious
fact in symbolic dynamics that describing such things on a shift of finite
type are -fiendishly- difficult. -- Chris Hillman
 
C

Charles Sullivan

That's probably true for most C developers - I certainly hope that it
is, anyway. But we're still supporting some products in some pre-
standard implementations, due to contractual obligations. (I think
Sinix is one platform where we're still constrained to a pre-standard
implementation.) So there are still some commercial C products being
actively maintained for pre-C90 implementations.

Fortunately, that seems to be quite rare, and I agree with Keith that
it seems to be safe to assume at least C90 as a default.

(I can't wait for the day when we can get rid of those platforms.
However, I see postings from people on comp.lang.cobol who can't use
the 1985 COBOL yet, so they've had four more years of pain. Man with
no feet and all that.)

Thanks Michael, I appreciate your inputs.

Regards,
Charles Sullivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,476
Latest member
blackwatermelon

Latest Threads

Top