i386.c warnings cleanup
Robert Lipe
robertl@dgii.com
Tue Feb 10 03:34:00 GMT 1998
> This patch fixes all but two -Wall warnings in config/i386/i386.c
Lovely. Thank you.
> +extern void error PVPROTO((char *s, ...));
> +extern void set_float_handler PROTO((jmp_buf));
There needs to be some gcc header file that contians protos for things
like error() that are essentially globals.
> +extern int atoi PROTO((char *));
> +extern void free PROTO((void *));
> +extern void bcopy PROTO((void *, void *, int n));
But what if bcopy accepts const void pointers? What if free() returns
an int? (this was common practice long ago).
We should avoid divinely knowing what we think are the correct protos
for system functions. 'Tis better to use what the system gives us.
How would you feel about getting the protos for the first two via:
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
The last one seems to find favor in this technique, though I don't
recall seeing any counter that this doesn't work well for all cases:
#ifdef HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#endif
RJL
More information about the Gcc
mailing list