https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396
--- Comment #4 from Bruno Haible <bruno at clisp dot org> --- (In reply to Richard Biener from comment #3) > But note that while free() may clobber errno the state after it is undefined > (it's not documented to set it to any specific value). So I'd argue the > check_errno_unmodified testcase is not really relevant. The state of errno after calling free() is not "undefined", it is "unspecified". See the POSIX citation in the description. See also the definition of "undefined behavior" and "unspecified behavior" in ISO C 2018 § 3.4.3 and § 3.4.4. The test case 'check_errno_unmodified' is therefore perfectly valid with glibc versions newer than 2020-12-29 (where https://sourceware.org/bugzilla/show_bug.cgi?id=17924 is fixed). In these glibc versions glibc gives the guarantee that free() does not clobber errno. If you (the GCC people) don't want to make this test case work unconditionally, you at least need to tell in which way the free() declaration in glibc's <stdlib.h> needs to be modified, so that the test case will work in these newer versions of glibc.