Avoid type punning on pointers to values. Leave type punning on values. https://gcc.gnu.org/PR97264 https://sourceware.org/PR26690 --- a/stdio-common/vfscanf-internal.c +++ b/stdio-common/vfscanf-internal.c @@ -486,7 +486,9 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr, /* Check for a positional parameter specification. */ if (ISDIGIT ((UCHAR_T) *f)) { - argpos = read_int ((const UCHAR_T **) &f); + const UCHAR_T * uf = (void*)f; + argpos = read_int (&uf); + f = (void*)uf; if (*f == L_('$')) ++f; else @@ -521,8 +523,11 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr, /* Find the maximum field width. */ width = 0; - if (ISDIGIT ((UCHAR_T) *f)) - width = read_int ((const UCHAR_T **) &f); + if (ISDIGIT ((UCHAR_T) *f)) { + const UCHAR_T * uf = (void*)f; + width = read_int (&uf); + f = (void*)uf; + } got_width: if (width == 0) width = -1;