managarm / mlibc

Portable C standard library
Other
851 stars 130 forks source link

printf frigg assertion failure #1100

Open Dennisbonke opened 3 months ago

Dennisbonke commented 3 months ago

While trying to configure coreutils, in the checking whether printf supports POSIX/XSI format strings with positions check, the following assertion is tripped: include/frg/printf.hpp:65: Assertion 'opts->arg_pos <= vsp->num_args' failed! The code it's trying to execute is as follows:

/* The string "%2$d %1$d", with dollar characters protected from the shell's
   dollar expansion (possibly an autoconf bug).  */
static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
static char buf[100];
int main ()
{
  sprintf (buf, format, 33, 55);
  return (strcmp (buf, "55 33") != 0);
}