Connecting Tech Pros Worldwide Forums | Help | Site Map

Qualifier "volatile" - probably OT.

Charles Sullivan
Guest
 
Posts: n/a
#1: Nov 28 '05
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


Keith Thompson
Guest
 
Posts: n/a
#2: Nov 28 '05

re: Qualifier "volatile" - probably OT.


Charles Sullivan <cwsulliv@triad.rr.com> writes:[color=blue]
> 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?[/color]

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.)

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Christopher Benson-Manica
Guest
 
Posts: n/a
#3: Nov 28 '05

re: Qualifier "volatile" - probably OT.


Charles Sullivan <cwsulliv@triad.rr.com> wrote:
[color=blue]
> Are there realistically any major C compilers in use today that
> don't recognize this qualifier?[/color]

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.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Charles Sullivan
Guest
 
Posts: n/a
#4: Nov 29 '05

re: Qualifier "volatile" - probably OT.


On Mon, 28 Nov 2005 23:07:19 +0000, Christopher Benson-Manica wrote:
[color=blue]
> Charles Sullivan <cwsulliv@triad.rr.com> wrote:
>[color=green]
>> Are there realistically any major C compilers in use today that
>> don't recognize this qualifier?[/color]
>
> 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.[/color]

Thanks Christopher and Keith, your responses were most
appreciated.

Regards,
Charles Sullivan

Jordan Abel
Guest
 
Posts: n/a
#5: Nov 29 '05

re: Qualifier "volatile" - probably OT.


On 2005-11-28, Keith Thompson <kst-u@mib.org> wrote:[color=blue]
> Charles Sullivan <cwsulliv@triad.rr.com> writes:[color=green]
>> 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?[/color]
>
> 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.)[/color]

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?
Keith Thompson
Guest
 
Posts: n/a
#6: Nov 29 '05

re: Qualifier "volatile" - probably OT.


Jordan Abel <jmabel@purdue.edu> writes:[color=blue]
> On 2005-11-28, Keith Thompson <kst-u@mib.org> wrote:[color=green]
>> Charles Sullivan <cwsulliv@triad.rr.com> writes:[color=darkred]
>>> 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?[/color]
>>
>> 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.)[/color]
>
> 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?[/color]

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.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Michael Wojcik
Guest
 
Posts: n/a
#7: Dec 1 '05

re: Qualifier "volatile" - probably OT.



In article <lnu0dwpe55.fsf@nuthaus.mib.org>, Keith Thompson <kst-u@mib.org> writes:[color=blue]
> 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.[/color]

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 michael.wojcik@microfocus.com

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
Charles Sullivan
Guest
 
Posts: n/a
#8: Dec 2 '05

re: Qualifier "volatile" - probably OT.


On Thu, 01 Dec 2005 14:42:53 +0000, Michael Wojcik wrote:
[color=blue]
>
> In article <lnu0dwpe55.fsf@nuthaus.mib.org>, Keith Thompson <kst-u@mib.org> writes:[color=green]
>> 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.[/color]
>
> 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.)[/color]

Thanks Michael, I appreciate your inputs.

Regards,
Charles Sullivan


Closed Thread


Similar C / C++ bytes