[PATCH] sim: or1k: fix include ordering with sim-main.h

Mike Frysinger vapier@gentoo.org
Sat Jan 9 19:11:14 GMT 2021


Make sure config.h is included before C library headers otherwise the
later libiberty.h include gets confused about asprintf state leading
to warnings like:
common/sim-utils.c:330:9:
	warning: implicit declaration of function 'vasprintf';
	did you mean 'xvasprintf'? [-Wimplicit-function-declaration]
---
 sim/or1k/sim-main.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sim/or1k/sim-main.h b/sim/or1k/sim-main.h
index f91a351a2db1..cac1abb2b8fb 100644
--- a/sim/or1k/sim-main.h
+++ b/sim/or1k/sim-main.h
@@ -21,6 +21,8 @@
 
 #define WITH_SCACHE_PBB 1
 
+#include "config.h"
+
 #include "ansidecl.h"
 #include "or1k-desc.h"
 #include "sim-basics.h"
-- 
2.28.0



More information about the Gdb-patches mailing list