On 7/29/22 08:26, Carlos O'Donell via Libc-alpha wrote: > Just posting here for the record that I see a glibc 2.36 build failure > with Fedora 36 and gcc 12. > > localealias.c: In function ‘read_alias_file’: > localealias.c:335:56: error: pointer may be used after ‘realloc’ [-Werror=use-after-free] > 335 | map[i].alias += new_pool - string_space; > | ~~~~~~~~~^~~~~~~~~~~~~~ > localealias.c:325:49: note: call to ‘realloc’ here > 325 | char *new_pool = (char *) realloc (string_space, new_size); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > I'm going to review this quickly before we make the glibc release. > One option is to fix the conformance bug rather than continue to try to paper it over with a pragma. In looking into it, I found two kinds of conformance bugs in localealias.c: first, accessing a realloced pointer (which GCC warns about), and second, calling a function via an incompatible function pointer (which GCC doesn't warn about). Proposed patch attached. I have compiled but not tested this.