Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!sri-unix!amdahl!dlb!auspyr!sci!kenm From: kenm@sci.UUCP (Ken McElvain) Newsgroups: comp.lang.c Subject: Re: Bug in cc on VAX 11/785 with Berkeley 4.2 ? Message-ID: <6988@sci.UUCP> Date: Sat, 11-Jul-87 20:14:53 EDT Article-I.D.: sci.6988 Posted: Sat Jul 11 20:14:53 1987 Date-Received: Mon, 13-Jul-87 00:58:13 EDT References: <264@crin.UUCP> Organization: Silicon Compilers Systems Corp. San Jose, Ca Lines: 37 Summary: extern function declaration with an argument In article <264@crin.UUCP>, tombre@crin.UUCP (Karl Tombre) writes: - Here are some lines from a dbx run to illustrate the problem : - - vax Cprog 52 %dbx sagat - dbx version of 11/2/83 16:31 (ucbmonet). - Type 'help' for help. - reading symbolic information ... - (dbx) list pos_ecrit - - 9 pos_ecrit(pf,nom,mode,d) <== this is the original code - 10 FILE *pf; - 11 char *nom,*mode; - 12 long d; - 13 - - (dbx) whatis pos_ecrit - - int pos_ecrit(c, pf, nom, mode, d) - int c; <== where does this c come from ?? - struct _iobuf *pf; - char *nom; - char *mode; - int d; - Probably somewhere above the function pos_ecrit there is a bad extern function declaration looking something like int foo(c); The argument c of foo, which should't be there but is not checked for, gets prepended onto the argument list for pos_ecrit. Since the type is not specified it defaults to an int. I spent most of a day chasing this down when it happened to me. Ken McElvain decwrl!sci!kenm