On Mon, 2 Feb 2026 at 15:36, Philippe Mathieu-Daudé <[email protected]> wrote:
>
> Since more then 5 years the '-cpu any' is aliased to '-cpu max'
> (see commit a0032cc5427 "target/arm: Make 'any' CPU just an alias
> for 'max'"). Time to deprecate the alias so we can eventually
> remove the alias code. Emit a warnig meanwhile.
>
> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
> Reviewed-by: Richard Henderson <[email protected]>

> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 586202071d0..da664c4e30a 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -2218,6 +2218,7 @@ static ObjectClass *arm_cpu_class_by_name(const char 
> *cpu_model)
>       * which has the same semantics as "-cpu max".
>       */
>      if (!strcmp(cpunamestr, "any")) {
> +        warn_report("CPU type 'any' is deprecated, use 'max' instead.");
>          cpunamestr = "max";
>      }

This doesn't compile:

../../target/arm/cpu.c: In function ‘arm_cpu_class_by_name’:
../../target/arm/cpu.c:2224:9: error: implicit declaration of function
‘warn_report’ [-Werror=implicit-function-declaration]
 2224 |         warn_report("CPU type 'any' is deprecated, use 'max' instead.");
      |         ^~~~~~~~~~~
../../target/arm/cpu.c:2224:9: error: nested extern declaration of
‘warn_report’ [-Werror=nested-externs]


Also linux-user still asks for "any" by default in the
arm and aarch64 get_elf_cpu_model() functions, as does
bsd-user in its TARGET_DEFAULT_CPU_MODEL macros.

This seems to me like the kind of deprecation that is more
effort than keeping the compat handling around, if it's only
three lines of code in arm_cpu_class_by_name(). Or is this
going to get in the way of some cleanup we'd like to do ?

thanks
-- PMM

Reply via email to