static arguments
Ron DeBlock
ron at njitcccc.UUCP
Sat May 31 08:46:35 AEST 1986
A new member of our staff was recently having problems with a set of functions
he was writing. Our system is a 3B5 running UNIX System V Realease 2.
He accidently declared the arguments to his function as static, like so:
struct whatever *foobar(arg1,arg2)
static char *arg1, *arg2;
{
.
.
.
}
I realize that it really makes no sense to do that, but the compiler did not
flag the "error". The only indication of the problem was when ld complained
that ".L157" and ".L158" were undefined symbols. The only place where I've
seen symbol names like that is the assembly output of the compiler so I checked
that. The undefined symbols were found in a section which seemed to reference
the arguments, which led me to the problem.
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
"Beware of programmers carrying screwdrivers."
More information about the Comp.lang.c
mailing list