home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.std.c
- Subject: Re: space optimization involving enum
- Message-ID: <17dvn3INNglh@early-bird.think.com>
- Date: 25 Aug 92 18:55:31 GMT
- References: <spuler.714711530@coral.cs.jcu.edu.au> <1992Aug25.153909.17977@email.tuwien.ac.at>
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 20
- NNTP-Posting-Host: telecaster.think.com
-
- In article <1992Aug25.153909.17977@email.tuwien.ac.at> hp@vmars.tuwien.ac.at (Peter Holzer) writes:
- >When the callee is compiled, the compiler cannot know if there is a
- >prototype in scope of the caller.
-
- Actually, doesn't the standard require that function
- declarations/prototypes and definitions be consistent with each other? If
- the function is defined with an ANSI parameter list, the caller must have a
- prototype in scope. If the function is defined with a K&R1 parameter list,
- the caller can use an old-style declaration (or no declaration at all,
- letting it default, if the function returns int).
-
- In particular, with K&R declarations, chars are always widened to ints when
- calling a function, while with ANSI prototypes they're passed as chars.
- This is very similar to the enum conversion that you were talking about.
-
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-