Skip to contentSkip to conversation

hw/ppc/spapr: Include missing 'sysemu/tcg.h' header

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Mar 22, 2024 – Mar 26, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/ppc/spapr: Include missing 'sysemu/tcg.h' header

"sysemu/tcg.h" declares tcg_enabled(), and is implicitly included. Include it explicitly to avoid the following error when refactoring headers:

hw/ppc/spapr.c:2612:9: error: call to undeclared function 'tcg_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

    if (tcg_enabled()) {
        ^
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index c417f9dd52..e9bc97fee0 100644
@@ -35,6 +35,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/hostmem.h"
 #include "sysemu/numa.h"
+#include "sysemu/tcg.h"
 #include "sysemu/qtest.h"
 #include "sysemu/reset.h"
 #include "sysemu/runstate.h"
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Philippe Mathieu-Daudé

"sysemu/tcg.h" declares tcg_enabled(), and is implicitly included. Include it explicitly to avoid the following error when refactoring headers:

   hw/ppc/spapr.c:2612:9: error: call to undeclared function 'tcg_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     if (tcg_enabled()) {
         ^
Quoted 16 lines
---
  hw/ppc/spapr.c | 1 +
  1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index c417f9dd52..e9bc97fee0 100644
@@ -35,6 +35,7 @@
  #include "sysemu/sysemu.h"
  #include "sysemu/hostmem.h"
  #include "sysemu/numa.h"
+#include "sysemu/tcg.h"
  #include "sysemu/qtest.h"
  #include "sysemu/reset.h"
  #include "sysemu/runstate.h"