This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Some cleanups in defs.h
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 14 Aug 2004 23:03:52 +0200 (CEST)
- Subject: [PATCH] Some cleanups in defs.h
GDB should not be providing these prototypes. Especially the getenv()
prototype hurts systems with out-of-date headers where the argument of
getenv isn't const.
If people get warnings about missing prototypes on their system, we
should check for the declaration instead, and only provide the
prototype if it's missing.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* defs.h: Remove out-of-date comment.
[!FCLOSE_PROVIDED] (fclose): Remove prototype.
[!GETENV_PROVIDED] (getenv): Remove prototype.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.160
diff -u -p -r1.160 defs.h
--- defs.h 14 Aug 2004 13:37:51 -0000 1.160
+++ defs.h 14 Aug 2004 20:54:50 -0000
@@ -1072,10 +1072,6 @@ enum gdb_osabi
Libiberty thingies are no longer declared here. We include libiberty.h
above, instead. */
-#ifndef GETENV_PROVIDED
-extern char *getenv (const char *);
-#endif
-
/* From other system libraries */
#ifdef HAVE_STDDEF_H
@@ -1093,15 +1089,6 @@ extern char *getenv (const char *);
#endif
-/* We take the address of fclose later, but some stdio's forget
- to declare this. We can't always declare it since there's
- no way to declare the parameters without upsetting some compiler
- somewhere. */
-
-#ifndef FCLOSE_PROVIDED
-extern int fclose (FILE *);
-#endif
-
#ifndef atof
extern double atof (const char *); /* X3.159-1989 4.10.1.1 */
#endif