This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] s390-nat.c: Fix missing prototypes
On 03/06/2012 09:49 AM, Andreas Arnez wrote:
> Joel Brobecker <brobecker@adacore.com> writes:
>
>>> Tested on s390x-ibm-linux with no regressions, fixes a
>>> -Wmissing-prototypes build failure.
>>>
>>> gdb/
>>> 2012-03-05 Andreas Arnez <arnez@linux.vnet.ibm.com>
>>>
>>> * s390-nat.c: Include "gregset.h".
>>
>> Thanks! Attached is what I committed for you. I dropped the comment,
>> since I felt it was completely redundant.
>
> Thanks! Dropping the comment is OK. However, you also relocated the
> include statement. This doesn't work, because "gregset.h" uses a
> typedef from the system header file <sys/ucontext.h>. The order of
> inclusion matters, and any other than my original patch may not work
> either.
Every other linux arch I looked at included <sys/procfs.h> before gregset.h
instead (or gdb_proc_service.h, which pulls sys/procfs.h).
Even core-regset.c does:
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
...
Are s390's headers different in this regard?
I think we should consider putting
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
in gregset.h itself.
--
Pedro Alves