On Samstag, 13. September 2025 20:21:34 CEST Pádraig Brady wrote:
> On 13/09/2025 05:42, Bruno Haible wrote:
> > Collin Funk wrote:
> >> It would be nice to add a test module, but I'm conflicted on whether it
> >> is too much of a chore. Since there isn't an easy way to check if a
> >> hwcap is supported at runtime.
> > 
> > A unit test for the hwcap_allowed function would be useful. That's a
> > string parsing function, that apparently needs to deal with multiple
> > cases:
> >    - GLIBC_TUNABLES not set,
> >    - GLIBC_TUNABLES set to empty,
> >    - other tunables than glibc.cpu.hwcaps,
> >    - glibc.cpu.hwcaps being the first one,
> >    - glibc.cpu.hwcaps being the last one,
> >    - glibc.cpu.hwcaps present but preceded and followed by other tunables,
> >    - glibc.cpu.hwcaps specifying multiple features.
> > It's complicated enough to confuse me during code review...
> 
> Thanks for the reviews all.
> I'll push the attached later (with a ChangeLog entry).
> 
> cheers,
> Padraig

> +   use other interfaces like getaxuval() instead.  */

Typo: getaxuval → getauxval

modules/cpu-supports-tests needs to depend on modules
  setenv
  unsetenv
since these functions are missing on some platforms.

> +#include <stdlib.h>
> +
> +/* Specification.  */
> +#include "cpu-supports.h"

It's better to #include "cpu-supports.h" directly after config.h.
This verifies that it is a self-container header (i.e. does not
accidentally use types or functions from <stdlib.h>).

Bruno






Reply via email to