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]

Re: [PATCH] Don't check HAVE_UNISTD_H


On 2018-09-26 07:31, Tom Tromey wrote:
I noticed some spots that were checking HAVE_UNISTD_H.  There is no
need to do this, as <unistd.h> is unconditionally included in many
places in gdb.  This sort of cleanup was done once before, in 2013:

    2013-07-01  Pedro Alves  <palves@redhat.com>

	    * defs.h: Don't check HAVE_UNISTD_H before including <unistd.h>.
	    (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete.
	    * tracepoint.c: Don't check HAVE_UNISTD_H before including
	    <unistd.h>.

HAVE_UNISTD_H seems to come from gnulib, so there are still mentions
of it in the source.

LGTM. Maybe we could even remove all includes of unistd.h except the one in defs.h, since defs.h is known to be included first in every source file. But they are harmless so it's probably not worth the effort.

Simon


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