Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: function prototype problem Message-ID: <8889@smoke.BRL.MIL> Date: 14 Nov 88 21:24:37 GMT References: <310@drd.UUCP> <1704@scolex> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: na Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 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).