[comp.lang.c] Type Qualifier volatile

leo@ehviea.ine.philips.nl (Leo de Wit) (05/25/90)

In article <1990May22.124936.5727@aucs.uucp> 880716a@aucs.UUCP (Dave Astels) writes:
|In article <4275@infmx.UUCP> briand@infmx.UUCP (brian donat) writes:
|>    When would a programmer want to explicitly use the 
|>		'auto' storage class? 
|
|I've often wondered that myself.  If you find out, let me know.

Today's tendency for J. Random Hacker is to prefer 'bike' storage class
to 'auto' storage class; using additional keywords like push(-bike) to
explicitly request stack allocation, or mountain (bike) for huge
stacks.  The last one is not supported very well on Intel architectures.

:-).

    Leo.

dankg@monsoon.Berkeley.EDU (Dan KoGai) (05/26/90)

In article <803@ehviea.ine.philips.nl> leo@ehviea.UUCP (Leo de Wit) writes:
>In article <1990May22.124936.5727@aucs.uucp> 880716a@aucs.UUCP (Dave Astels) writes:
>|In article <4275@infmx.UUCP> briand@infmx.UUCP (brian donat) writes:
>|>    When would a programmer want to explicitly use the 
>|>		'auto' storage class? 
>|
>|I've often wondered that myself.  If you find out, let me know.

	Come to think there's no such storage classes as "manual", and I
never heard of explicit decreation of "intern" variable.  Is static opposite
to auto? (maybe).  If so auto must have been called "dynamic".

>Today's tendency for J. Random Hacker is to prefer 'bike' storage class
>to 'auto' storage class; using additional keywords like push(-bike) to
>explicitly request stack allocation, or mountain (bike) for huge
>stacks.  The last one is not supported very well on Intel architectures.

	I buy it.  And instead of segmentation fault, you get "flat tire",
"chain is torn", etc.  But in this implementation, pop sometimes dumps
core :)

----------------
____  __  __    + Dan The "obfuscunated" Man
    ||__||__|   + E-mail:	dankg@ocf.berkeley.edu
____| ______ 	+ Voice:	+1 415-549-6111
|     |__|__|	+ USnail:	1730 Laloma Berkeley, CA 94709 U.S.A
|___  |__|__|	+	
    |____|____	+ "What's the biggest U.S. export to Japan?" 	
  \_|    |      + "Bullshit.  It makes the best fertilizer for their rice"
Dan Kogai (dankg@ocf.berkeley.edu)

mikero@microsoft.UUCP (Michael ROBIN) (05/31/90)

In article <803@ehviea.ine.philips.nl> leo@ehviea.UUCP (Leo de Wit) writes:
>In article <1990May22.124936.5727@aucs.uucp> 880716a@aucs.UUCP (Dave Astels) writes:
>|In article <4275@infmx.UUCP> briand@infmx.UUCP (brian donat) writes:
>|>    When would a programmer want to explicitly use the 
>|>		'auto' storage class? 
>|
>|I've often wondered that myself.  If you find out, let me know.
>

Gee, don't you guys know anything? You use "auto" to line up your declarations:

  static   int x;                    static   int x;
  register int y;   instead of       register int y; 
  auto     int z;                    int z;

:)

ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) (05/31/90)

In article <4275@infmx.UUCP> briand@infmx.UUCP (brian donat) writes:
> When would a programmer want to explicitly use the 'auto' storage class? 
In article <54963@microsoft.UUCP>, mikero@microsoft.UUCP (Michael ROBIN) writes:
> Gee, don't you guys know anything? You use "auto" to line up your declarations:

I have been waiting for the people who were _there_ to answer, but so far
no-one has.  The answer is HISTORY.  C had 'storage' qualifiers BEFORE it
had types.  (Take a look at 'bc' some time.)  (At that time, it did not
have nested blocks.)  So you would write

	foo(a)			/* a is an int, foo returns int */
	    {
		static b;	/* b is a static int */
		auto c;		/* c is an "automatic" int */
		...
	    }

In fact you can still write your programs that way if you really want to.
C is descended from B which is derived from BCPL, in which there was one
type, "machine word" (which also served as pointer and float).
-- 
"A 7th class of programs, correct in every way, is believed to exist by a
few computer scientists.  However, no example could be found to include here."

john@stat.tamu.edu (John S. Price) (05/31/90)

In article <3115@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>In article <4275@infmx.UUCP> briand@infmx.UUCP (brian donat) writes:
>I have been waiting for the people who were _there_ to answer, but so far
>no-one has.  The answer is HISTORY.  C had 'storage' qualifiers BEFORE it
>had types.  (Take a look at 'bc' some time.)  (At that time, it did not
 
I think I stated this from the beginning...  I guess everyone ignored
it.  Oh well...

Yes, the use of auto was inherited from earlier C implementations, and
from B, as the previous poster stated.



--------------------------------------------------------------------------
John Price                   |   It infuriates me to be wrong
john@stat.tamu.edu           |   when I know I'm right....
--------------------------------------------------------------------------