home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!convex!news.utdallas.edu!corpgate!crchh327!davisonj
- From: davisonj@bnr.ca (John Davison)
- Newsgroups: comp.std.c
- Subject: Re: mixing prototyping and non-prototyping
- Message-ID: <1992Aug20.044426.19417@bnr.ca>
- Date: 20 Aug 92 04:44:26 GMT
- References: <spuler.713749345@coral.cs.jcu.edu.au> <28616@vedge.UUCP>
- Sender: news@bnr.ca (News on crchh327)
- Organization: Bell-Northern Research, Richardson, Tx.
- Lines: 44
- Nntp-Posting-Host: crchh7ab
-
-
- In article <28616@vedge.UUCP> hendrik@vedge.UUCP (Hendrik Boom) writes:
- >Here's my standard handout on this subject:
- ...
- >Please comment,
- >especially if you detect errors in my interpretation.
- >Any and all of a function
- >definition, declaration, and call may contain information
- >about the argument types, with varying significan[c]e.
- ...
- >ANSI defines the old-stype functions to worl [sic] as follows.
- ...
- >The old-style rules apply whenever a function has neither
- >been declared with prototype syntax
- >nor been defined with new-style syntax.
-
- >To make this work at least some of the time,
- >a function defined using old-style syntax,
- >will expect its parameters to have been converted
- >using the standard argument promotion rules.
- >
- >A function with a single real argument, such as
- > f(r)real r;{ }
-
- You did not define "real".
-
- >(a) Include parameters in function declarations
- > conditional on the absence of _NO_PROTO.
- ...
- >Its use is not dictated or mentioned by the ANSI standard.
-
- To determine if a compiler is Standard C, the existence and value (should
- be 1 in standard C) of __STDC__ should be checked.
-
- You may also want to employ the "#error" preprocessor directive to yell
- at you if the configuration of compiler-supplied macros, values, etc. is such
- that your program will not run and/or compile correctly without modification.
-
-
- --
- NOTE: I CAN'T SEND/RECEIVE E-MAIL HERE!!! Use --> davisonj@ecn.purdue.edu <--
- During (roughly) August 20-25, I will be in transit. Please be patient.
- The opinions and other information contained herein are not necessarily
- representative of Northern Telecom or any of its subsidiaries.
-