[comp.std.c] ANSI grammar questions

karl@haddock.ima.isc.com (Karl Heuer) (11/18/88)

In article <179@twwells.uucp> bill@twwells.uucp (T. William Wells) writes:
>In article <7938@bloom-beacon.MIT.EDU> chekmate@athena.mit.edu (Adam Kao) writes:
>>So you can stack any number of storage_class_spec, type_spec, and type_qual
>>in front of your declaration, in any order?  Things like:
>>	void static fn();
>>	void static extern int auto volatile fn();
>
>Right. This is intentional. Believe it or not, there are situations
>where this flexibility is useful.

As I'm sure we all realize, the second is *not* legal C (it names two
conflicting types, and three conflicting storage classes).  More precisely,
although it satisfies the syntax rules, it violates the constraint rules.

Less well known, but perhaps of interest to y'all, is that the first
construct, though still legal, is obsolescent.  Don't use it in new programs.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint
Followups to comp.std.c.