This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Prototypes [was Re: Patch for bugs 772 and 17913]
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Gerald Pfeifer <gerald at pfeifer dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: Thu, 5 May 2005 17:06:15 -0400
- Subject: Re: Prototypes [was Re: Patch for bugs 772 and 17913]
- References: <427A7C07.6010003@codesourcery.com> <Pine.LNX.4.44.0505051405510.24817-100000@www.eyesopen.com>
On Thu, May 05, 2005 at 02:45:22PM -0600, Roger Sayle wrote:
> >> extern bool cfg_layout_can_duplicate_bb_p (basic_block);
> >>
> >> bool
> >> cfg_layout_can_duplicate_bb_p (basic_block bb)
> >> {
> >> ...
>
> i.e. there seems to be no good reason for prototyping a function as
> "extern" immediately before it's definition. Unless of course I'm
> missing something?
>
I typically do this for dump/debug functions that we want to
call from gdb but are usually not called from anywhere else. If
you declare them static, you get warnings and/or they get dropped
from the final binary.
If there's a better method, then let's use it. I don't feel any
particular attachment to this idiom.
Diego.