aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-10-06 14:50:46 -0400
committerJoel Brobecker <brobecker@adacore.com>2014-11-14 21:00:45 +0400
commit355e210214ba52d477f25b33de00dbbcfb566c70 (patch)
tree90a8b6b855eea78d74170189e606928e15211bf3 /gdb/common
parent1dfc6506b7482baf86dbb3c91de5bd2ae3f5acda (diff)
downloadfsf-binutils-gdb-355e210214ba52d477f25b33de00dbbcfb566c70.zip
fsf-binutils-gdb-355e210214ba52d477f25b33de00dbbcfb566c70.tar.gz
fsf-binutils-gdb-355e210214ba52d477f25b33de00dbbcfb566c70.tar.bz2
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.
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/common-defs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 29c8ab3..4d2e8a7 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -27,9 +27,9 @@
#include "build-gnulib/config.h"
#endif
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>