This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 8/9] Normalize on PATH_MAX instead of MAXPATHLEN throughout.
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 28 Jun 2013 19:05:23 +0100
- Subject: Re: [PATCH 8/9] Normalize on PATH_MAX instead of MAXPATHLEN throughout.
- References: <20130627185200 dot 6625 dot 10526 dot stgit at brno dot lan> <20130627185257 dot 6625 dot 19906 dot stgit at brno dot lan> <87mwqal0w4 dot fsf at fleche dot redhat dot com>
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