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

Philippe Mathieu-Daudé posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240322162459.7173-1-philmd@linaro.org
Maintainers: Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Harsh Prateek Bora <harshpb@linux.ibm.com>
hw/ppc/spapr.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] hw/ppc/spapr: Include missing 'sysemu/tcg.h' header
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
"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()) {
        ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c417f9dd52..e9bc97fee0 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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"
-- 
2.41.0


Re: [PATCH] hw/ppc/spapr: Include missing 'sysemu/tcg.h' header
Posted by Harsh Prateek Bora 1 month ago

On 3/22/24 21:54, Philippe Mathieu-Daudé wrote:
> "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()) {
>          ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>

> ---
>   hw/ppc/spapr.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index c417f9dd52..e9bc97fee0 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -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"