static arguments

ricmtodd at uok.UUCP ricmtodd at uok.UUCP
Thu Jun 5 04:47:00 AEST 1986


/* Written  5:46 pm  May 30, 1986 by ron at njitcccc.UUCP in uok.UUCP:net.lang.c */
>The question is, are static arguments legal even though they make no sense?
>If not, why doesn't the compiler flag the problem?  If they are legal, have
>we discovered a bug in our linker?
>
>Thanks in advance for any enlightening information.
>-- 
>Ron DeBlock
>New Jersey Institute of Technology
>Computerized Conferencing and Communications Center
>Newark, NJ 07102
>
>	uucp: ...!allegra!bellcore!njitcccc!ron
>	      ...!andromeda!njitcccc!ron
>	arpa: njitcccc!ron at bellcore.arpa
>	bitnet: ron%njitcccc.bitnet
/* End of text from uok.UUCP:net.lang.c */

Quoting from Appendix A of Kernighan and Ritchie, p. 203, about argument lists:
     "The only storage class which may be specified is register; . . ."
Thus static arguments are indeed illegal.
A couple of quick tests show that both the compiler on uok (BSD 2.9) and the
compiler on my PC (Aztec C) object to static declared arguments. The BSD
UNIX compiler gives:

temp.c:1: Conflict in storage class
temp.c:1: x redeclared

Aztec C gives an "Internal Error" message. Not very informative, but it does
at least point a caret at the offending declaration.

                          Richard Todd
                          {allegra!cbosgd|ihnp4}!okstate!uokvax!uok!ricmtodd



More information about the Comp.lang.c mailing list