On 10/24/21 2:26 AM, Eli Zaretskii wrote: > Let me turn the table and ask why that declaration of strdup is at all > needed in Gnulib's string.h when it's used in MinGW builds? It's so that apps can be checked better statically. For example, the contrived code:    return strcmp (x, strdup (x)); getts a diagnostic about a memory leak. This can be helpful regardless of whether Gnulib's strdup substitute code is used. The Gnulib wrapper here is merely mimicking what glibc does; it's not a Gnulib invention. > ntlib cannot include config.h, > due to various redefinitions and redirections we do in ms-w32.h for > Emacs. I now see Emacs has a symbol DEFER_MS_W3_H to deal with this glitch. So how about the attached patch instead? If it doesn't suffice, presumably something like DEFER_MS_W3_H would suffice.