home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!rpi!psinntp!psinntp!dg-rtp!sheol!throopw
- From: throopw@sheol.UUCP (Wayne Throop)
- Newsgroups: comp.lang.c
- Subject: Re: question about duplicate declarations
- Summary: possible use for function declarations inside function bodies
- Message-ID: <722322699@sheol.UUCP>
- Date: 21 Nov 92 02:13:48 GMT
- References: <2R28E4L@math.fu-berlin.de> <27543@dog.ee.lbl.gov>
- Lines: 26
-
- :: From: rene@hamel.uucp (Rene Mueller)
- :: Message-ID: <2R28E4L@math.fu-berlin.de>
- :: So code like
- :: typ f1(paramlist) { typ f2(paramlist); ... }
- :: Shouldn't be in ANY programm...
-
- : From: torek@horse.ee.lbl.gov (Chris Torek)
- : Message-ID: <27543@dog.ee.lbl.gov>
- : (Stylistically, I happen to agree; function declarations with block
- : scope provide nothing that the same declaration with file or global
- : scope would give, except the chance to make a mistake.)
-
- I can think of a legitimate use of the construct. And that is to
- encourage the compiler to give warnings when a function is used from
- a location that the developer did not intend.
-
- Eg: void portable_foo(void){
- void host_specific_foo(void);
- host_specific_foo();
- }
-
- This records the developer's intent to use portable_foo everywhere else
- in the program (even in other functions in the same file), in order
- to localize the "infection" of the use of the host-specific function.
- --
- Wayne Throop ...!mcnc!dg-rtp!sheol!throopw
-