Path: utzoo!attcan!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: comp.lang.c
Subject: Re: Curious about function prototypes...
Message-ID: <8115@brl-smoke.ARPA>
Date: 18 Jun 88 01:33:44 GMT
References: <654@orion.cf.uci.edu> <8073@brl-smoke.ARPA> <5808@bloom-beacon.MIT.EDU>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) )
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 18

In article <5808@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes:
>How much, and why, are old-style declarations disparaged in new-style code?

Mixing of old- and new-style declarations/definitions should work okay
so long as the functions take a fixed number of arguments, each of which
has a type that is not changed by the old-style argument widening rules.

The main reason that the interface is allowed to differ between old- and
new-style functions is to permit implementations to avoid widening, for
example of float to double or of char to int.  It also makes for stricter
type checking.

>Is it wrong for a compiler to construct some kind of Miranda prototype, when
>an old-style function definition is seen, which could be used for lint-style
>argument mismatch warnings (*not* ANSI-style implicit argument coercions)?

The compiler can issue any warnings it wishes, but to be Standard conforming
it must follow the rules (i.e. produce valid code from a valid program).