Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [COMMIT/RFC] Always include <sys/types.h> from defs.h
@ 2005-05-09 19:44 Mark Kettenis
  2005-05-09 21:22 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2005-05-09 19:44 UTC (permalink / raw)
  To: gdb-patches

Including <sys/types.h> is a prerequisite to including many of the
other <sys/...> header files on BSD-derived systems.  Since it isn't
the case on Linux, evry now and then the build is broken when someone
developing on Linux adds <sys/whetever.h>.  This patch prevents this
from happening ever again.

Committed as obvious, since this is what bfd/sysdep.h and
opcodes/sysdep.h already do.  Makes GDB build on vax-dec-ultrix4.0
again ;-).

Raises the question whether we should move towards eliminating
<sys/types.h> from all other GDB source files.  What do folks think
about that?

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* defs.h: Unconditionally include <sys/types.h>.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.184
diff -u -p -r1.184 defs.h
--- defs.h 8 May 2005 14:57:41 -0000 1.184
+++ defs.h 9 May 2005 17:19:26 -0000
@@ -26,14 +26,13 @@
 
 #include "config.h"		/* Generated by configure.  */
 
+#include <sys/types.h>
 #include <stdio.h>
 #include <errno.h>		/* System call error return status.  */
 #include <limits.h>
 
 #ifdef HAVE_STDDEF_H
 #include <stddef.h>
-#else
-#include <sys/types.h>		/* For size_t.  */
 #endif
 
 #ifdef HAVE_UNISTD_H


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [COMMIT/RFC] Always include <sys/types.h> from defs.h
  2005-05-09 19:44 [COMMIT/RFC] Always include <sys/types.h> from defs.h Mark Kettenis
@ 2005-05-09 21:22 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2005-05-09 21:22 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

> Date: Mon, 9 May 2005 19:25:55 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> 
> Raises the question whether we should move towards eliminating
> <sys/types.h> from all other GDB source files.  What do folks think
> about that?

I don't think it's necessary.  It could even do harm if one day we
decide to remove this line from defs.h.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-09 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-09 19:44 [COMMIT/RFC] Always include <sys/types.h> from defs.h Mark Kettenis
2005-05-09 21:22 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox