This is the mail archive of the
mailing list for the GDB project.
Re: Proposal: convert function definitions to prototyped form
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: Proposal: convert function definitions to prototyped form
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 02 Jun 2000 19:42:04 +1000
- CC: gdb at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <1000602075018.ZM29997@ocotillo.lan>
Kevin Buettner wrote:
> As many of you know, I'm in the midst of purging the use of ``PARAMS''
> in prototyped function declarations from the gdb sources. After this
> activity is concluded, I'd like to begin converting function
> definitions whose parameters are declared using the traditional C
> style to the ISO C prototyped form. I.e, I'd like to convert
> functions of the form
> foo (a, b, c)
> int a;
> char *b;
> int *c;
> int foo (int a, char *b, int *c)
foo (int a, char *b, int *c)
The obvious thing to note is that by moving to pure ISO-C we eliminate
the type promotion problems. For instance:
void foo (enum e e);
enum e e;
is not well defined and many compilers reject it. Plenty of similar
examples (involving char, short, and the like exist).
It is one less issue that people need to worry about.
The only concern I have is, given the slightly more complex nature of
the script (compared to PARAMS) there is a possibility that the
conversion re-orders or re-types the argument list. With that in mind,
should a pre-cursor to this be to least have prototypes for all
(global?) functions (-Wmissing-prototypes?) or only do the conversion
when there is a prototype visible?
PS: You may want to add gdb/*-share to the list of directories to avoid.