[PATCH] configure: Remove unused variable default_cflags

Peter Maydell posted 1 patch 2 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260317120215.2075164-1-peter.maydell@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>
configure | 2 --
1 file changed, 2 deletions(-)
[PATCH] configure: Remove unused variable default_cflags
Posted by Peter Maydell 2 weeks, 6 days ago
configure has a variable default_cflags, which was originally added
in commit bafe78ad3bc4c ("contrib/plugins: use an independent
makefile") as part of it setting up the build environment for
contrib/plugins, which at the time used make.  However, we now build
the plugins with meson, and in commit 55c84a72aba4 ("contrib/plugins:
remove Makefile for contrib/plugins") we dropped the logic from
configure that does that makefile setup, leaving default_cflags
as an unused variable.

shellcheck helpfully reports this:
      default_cflags='-O0 -g'
      ^------------^ SC2034 (warning): default_cflags appears unused. Verify use (or export if used externally).

Remove the unused variable.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 configure | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configure b/configure
index cd1dadd8bb..42c45fe47a 100755
--- a/configure
+++ b/configure
@@ -248,7 +248,6 @@ for opt do
   esac
 done
 
-default_cflags='-O2 -g'
 git_submodules_action="update"
 docs="auto"
 EXESUF=""
@@ -707,7 +706,6 @@ for opt do
       meson_option_parse --enable-debug-graph-lock ""
       meson_option_parse --enable-debug-mutex ""
       meson_option_add -Doptimization=0
-      default_cflags='-O0 -g'
   ;;
   --disable-tcg) tcg="disabled"
   ;;
-- 
2.43.0
Re: [PATCH] configure: Remove unused variable default_cflags
Posted by Pierrick Bouvier 2 weeks, 4 days ago
On 3/17/26 5:02 AM, Peter Maydell wrote:
> configure has a variable default_cflags, which was originally added
> in commit bafe78ad3bc4c ("contrib/plugins: use an independent
> makefile") as part of it setting up the build environment for
> contrib/plugins, which at the time used make.  However, we now build
> the plugins with meson, and in commit 55c84a72aba4 ("contrib/plugins:
> remove Makefile for contrib/plugins") we dropped the logic from
> configure that does that makefile setup, leaving default_cflags
> as an unused variable.
> 
> shellcheck helpfully reports this:
>        default_cflags='-O0 -g'
>        ^------------^ SC2034 (warning): default_cflags appears unused. Verify use (or export if used externally).
> 
> Remove the unused variable.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   configure | 2 --
>   1 file changed, 2 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Re: [PATCH] configure: Remove unused variable default_cflags
Posted by Richard Henderson 2 weeks, 4 days ago
On 3/18/26 01:02, Peter Maydell wrote:
> configure has a variable default_cflags, which was originally added
> in commit bafe78ad3bc4c ("contrib/plugins: use an independent
> makefile") as part of it setting up the build environment for
> contrib/plugins, which at the time used make.  However, we now build
> the plugins with meson, and in commit 55c84a72aba4 ("contrib/plugins:
> remove Makefile for contrib/plugins") we dropped the logic from
> configure that does that makefile setup, leaving default_cflags
> as an unused variable.
> 
> shellcheck helpfully reports this:
>        default_cflags='-O0 -g'
>        ^------------^ SC2034 (warning): default_cflags appears unused. Verify use (or export if used externally).
> 
> Remove the unused variable.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   configure | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/configure b/configure
> index cd1dadd8bb..42c45fe47a 100755
> --- a/configure
> +++ b/configure
> @@ -248,7 +248,6 @@ for opt do
>     esac
>   done
>   
> -default_cflags='-O2 -g'
>   git_submodules_action="update"
>   docs="auto"
>   EXESUF=""
> @@ -707,7 +706,6 @@ for opt do
>         meson_option_parse --enable-debug-graph-lock ""
>         meson_option_parse --enable-debug-mutex ""
>         meson_option_add -Doptimization=0
> -      default_cflags='-O0 -g'
>     ;;
>     --disable-tcg) tcg="disabled"
>     ;;

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Re: [PATCH] configure: Remove unused variable default_cflags
Posted by Philippe Mathieu-Daudé 2 weeks, 6 days ago
On 17/3/26 13:02, Peter Maydell wrote:
> configure has a variable default_cflags, which was originally added
> in commit bafe78ad3bc4c ("contrib/plugins: use an independent
> makefile") as part of it setting up the build environment for
> contrib/plugins, which at the time used make.  However, we now build
> the plugins with meson, and in commit 55c84a72aba4 ("contrib/plugins:
> remove Makefile for contrib/plugins") we dropped the logic from
> configure that does that makefile setup, leaving default_cflags
> as an unused variable.
> 
> shellcheck helpfully reports this:
>        default_cflags='-O0 -g'
>        ^------------^ SC2034 (warning): default_cflags appears unused. Verify use (or export if used externally).
> 
> Remove the unused variable.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   configure | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/configure b/configure
> index cd1dadd8bb..42c45fe47a 100755
> --- a/configure
> +++ b/configure
> @@ -248,7 +248,6 @@ for opt do
>     esac
>   done
>   
> -default_cflags='-O2 -g'
>   git_submodules_action="update"
>   docs="auto"
>   EXESUF=""
> @@ -707,7 +706,6 @@ for opt do
>         meson_option_parse --enable-debug-graph-lock ""
>         meson_option_parse --enable-debug-mutex ""
>         meson_option_add -Doptimization=0
> -      default_cflags='-O0 -g'
>     ;;
>     --disable-tcg) tcg="disabled"
>     ;;

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>