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 8/9] Normalize on PATH_MAX instead of MAXPATHLEN throughout.


On 06/28/2013 04:18 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> 
> Pedro> With the pathmax gnulib module in place, we can use PATH_MAX
> Pedro> consistently throughout, instead of the current mixbag of PATH_MAX and
> Pedro> MAXPATHLEN uses.  It's no longer necessary to include sys/param.h
> Pedro> (supposedly, I can't check all ports touched here) for MAXPATHLEN.
> 
> After this patch, I think HAVE_SYS_PARAM_H is never used, so the
> configure.ac check can be removed as well.

Yeah, I had grepped for all uses of it, and also removed all unconditional
sys/param.h inclusions.

But there's one use left that is what made me pause on the unistd.h removal
from the checked headers.  Notice:

# elf_hp.h is for HP/UX 64-bit shared library support.
AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h sys/socket.h proc_service.h \
		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
...
		  dlfcn.h sys/un.h linux/perf_event.h])
...
AC_CHECK_HEADERS(sys/proc.h, [], [],
[#if HAVE_SYS_PARAM_H
 ^^^^^^^^^^^^^^^^^^^^
# include <sys/param.h>
#endif
])
...

I don't think we presently run the autoconf checks with -Ignulib/import,
so we still need to check for headers that are used in HAVE_FOO in configure
tests explicitly.  Maybe we should (run these checks with -Ignulib/import, or
include gnulib's config.h while running these tests, but I don't think the
latter would work), but I'd prefer treading with caution, and considering
that a separate change.  We also check for other headers that we have gnulib
replacements for, so such a change can do all of them in one pass.

-- 
Pedro Alves


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