Path: utzoo!attcan!uunet!husc6!mailrus!uflorida!gatech!mcnc!ece-csc!jnh From: jnh@ece-csc.UUCP (Joseph Nathan Hall) Newsgroups: comp.lang.c Subject: Re: function prototype problem Message-ID: <3839@ece-csc.UUCP> Date: 15 Nov 88 13:59:28 GMT References: <310@drd.UUCP> <1704@scolex> <8889@smoke.BRL.MIL> Reply-To: jnh@ece-csc.UUCP (Joseph Nathan Hall) Distribution: na Organization: North Carolina State University, Raleigh, NC Lines: 26 In article <8889@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: In article <1704@scolex> seanf@sco.COM (Sean Fagan) writes: -In article <310@drd.UUCP> mark@drd.UUCP () writes: ->char *rpeet ( short, char ); ->char *rpeet ( num, ch ) -> short num; -> char ch; -I, however, maintain what what ANSI says is that, if you declare a function -using old-style declaration (as you did), then you do not expand the -arguments unless a prototype is given; but if you use newstyle declarations -(char *rpeet ( short num, char ch) {), everything is as if you had also -given a prototype. I don't have the draft Standard at hand right now, but I'm pretty sure Stallman is right to have gcc diagnose this. Old-style function syntax requires widened arguments but the prototype indicates unwidened. This is clearly a type clash. It is possible that the draft Standard really says that a compiler has to straighten things out in cases like this example, but I would find it surprising (and dangerous). Not only does VAX (VMS) C diagnose this, it prohibits it. -- v v sssss|| joseph hall || 201-1D Hampton Lee Court v v s s || jnh@ece-csc.ncsu.edu (Internet) || Cary, NC 27511 v sss || the opinions expressed herein are not necessarily those of my -----------|| employer, north carolina state university . . . . . . . . . . .