old-cross-binutils/gdb/common
Joel Brobecker 355e210214 common-defs.h: include <stdarg.h> before <stdio.h>
When trying to build gdbserver on ppc-lynx178, the compiler reports
while trying to compile gdbserver/ax.c that vsprintf is not declared.
Looking at my C99 reference manual (a draft), I see the following
synopsis:

    #include <stdarg.h>
    #include <stdio.h>
    int vsprintf(char * restrict s, [etc]);

Looking at stdio.h on LynxOS-178, if found where vsprintf gets
declared:

    #if defined(__varargs_h) || defined(__stdarg_h) \
            || defined(_VARARGS_H) || defined(_STDARG_H)
    extern int vsprintf             _AP((char *, const char *, va_list));
    #endif

Digging further, I noticed that common-defs.h, which is included
via server.h, includes stdarg.h after including stdio, explaining
why vsprintf does not get declared in this case.

This patch fixes the problem by including stdarg.h before stdio.h.

gdb/ChangeLog:

        * common/common-defs.h: Move <stdarg.h> #include ahead of
        <stdio.h> #include.

Tested on x86_64-linux.
2014-11-14 21:00:45 +04:00
..
agent.c Rename target_{stop,continue}_ptid 2014-09-22 11:33:59 +01:00
agent.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ax.def Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
break-common.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
btrace-common.h Do not include defs.h or server.h in any header file 2014-07-31 13:25:01 +01:00
buffer.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
buffer.h Include string.h in common-defs.h 2014-08-07 09:06:47 +01:00
cleanups.c Move cleanups.[ch] to common 2014-08-29 10:53:35 +01:00
cleanups.h Move cleanups.[ch] to common 2014-08-29 10:53:35 +01:00
common-debug.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
common-debug.h Introduce show_debug_regs 2014-09-11 11:19:56 +01:00
common-defs.h common-defs.h: include <stdarg.h> before <stdio.h> 2014-11-14 21:00:45 +04:00
common-exceptions.c Include cleanups.h in common-defs.h 2014-10-08 09:33:22 +01:00
common-exceptions.h Introduce common/common-exceptions.[ch] 2014-08-29 10:53:37 +01:00
common-regcache.h Introduce common-regcache.h 2014-09-12 10:11:42 +01:00
common-types.h Introduce common-types.h 2014-08-19 10:07:19 +01:00
common-utils.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
common-utils.h Introduce common/errors.h 2014-08-19 10:07:18 +01:00
common.m4 Introduce common/gdb_setjmp.h 2014-08-29 10:53:36 +01:00
create-version.sh Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
errors.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
errors.h Move internal_{,v}warning to common/errors.[ch] 2014-08-29 10:53:35 +01:00
filestuff.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
filestuff.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
format.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
format.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb_assert.h Move common-utils.h to common-defs.h 2014-08-07 09:06:44 +01:00
gdb_locale.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb_setjmp.h Introduce common/gdb_setjmp.h 2014-08-29 10:53:36 +01:00
gdb_signals.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb_vecs.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
gdb_vecs.h Add delim_string_to_char_ptr_vec. 2014-01-17 10:23:29 -08:00
gdb_wait.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
host-defs.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
print-utils.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
print-utils.h share "cell" code 2014-02-12 09:59:13 -07:00
ptid.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
ptid.h Move ptid_match to common/ptid.c. 2014-02-27 14:30:07 +00:00
queue.h Include gdb_assert.h in common-defs.h 2014-08-07 09:06:45 +01:00
rsp-low.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
rsp-low.h update rsp-low comments 2014-02-12 09:59:20 -07:00
signals.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
symbol.h Introduce common/symbol.h 2014-09-11 11:43:21 +01:00
vec.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
vec.h Include string.h in common-defs.h 2014-08-07 09:06:47 +01:00
version.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
x86-xstate.h Rename 32- and 64-bit Intel files from "i386" to "x86" 2014-09-02 16:54:08 +01:00
xml-utils.c Include common-defs.h instead of defs.h/server.h in shared code 2014-09-12 10:11:42 +01:00
xml-utils.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00