This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: don't check uselessly for headers


I'm checking this in.

While looking at importing more of gnulib, I noticed that gdb's
configure script is checking for ctype.h and time.h -- but there are no
uses of HAVE_TIME_H and only a single use of HAVE_CTYPE_H.  So, per the
existing comment, these checks are useless.

This patch removes the checks and updates the one place using
HAVE_CTYPE_H.

Tested by rebuilding.

Tom

2012-11-14  Tom Tromey  <tromey@redhat.com>

	* configure, config.in: Rebuild.
	* configure.ac: Don't check for ctype.h, time.h.
	* expprint.c: Don't use HAVE_CTYPE_H.

Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.186
diff -u -r1.186 configure.ac
--- configure.ac	2 Nov 2012 18:53:54 -0000	1.186
+++ configure.ac	14 Nov 2012 19:12:05 -0000
@@ -1075,8 +1075,6 @@
 AC_HEADER_STAT
 AC_HEADER_STDC
 # elf_hp.h is for HP/UX 64-bit shared library support.
-# FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
-# unconditionally, so what's the point in checking these?
 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
                   thread_db.h signal.h stddef.h \
 		  stdlib.h string.h memory.h strings.h sys/fault.h \
@@ -1084,7 +1082,7 @@
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
 		  sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
 		  sys/types.h sys/wait.h wait.h termios.h termio.h \
-		  sgtty.h unistd.h elf_hp.h ctype.h time.h locale.h \
+		  sgtty.h unistd.h elf_hp.h locale.h \
 		  dlfcn.h sys/socket.h sys/un.h])
 AC_CHECK_HEADERS(link.h, [], [],
 [#if HAVE_SYS_TYPES_H
Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.63
diff -u -r1.63 expprint.c
--- expprint.c	13 Nov 2012 09:46:10 -0000	1.63
+++ expprint.c	14 Nov 2012 19:12:06 -0000
@@ -33,9 +33,7 @@
 #include "gdb_assert.h"
 #include "valprint.h"
 
-#ifdef HAVE_CTYPE_H
 #include <ctype.h>
-#endif
 
 void
 print_expression (struct expression *exp, struct ui_file *stream)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]