Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!caip!andromeda!njitcccc!ron From: ron@njitcccc.UUCP (Ron DeBlock) Newsgroups: net.lang.c Subject: static arguments Message-ID: <170@njitcccc.UUCP> Date: Fri, 30-May-86 18:46:35 EDT Article-I.D.: njitcccc.170 Posted: Fri May 30 18:46:35 1986 Date-Received: Sat, 31-May-86 07:26:46 EDT Organization: NJ Inst of Tech., Newark NJ Lines: 37 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@bellcore.arpa bitnet: ron%njitcccc.bitnet "Beware of programmers carrying screwdrivers."