https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24012
--- Comment #23 from Jonathan Wakely <redi at gcc dot gnu.org> --- Created attachment 41068 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41068&action=edit Use dynamic checks for C99 <wchar.h> functions This fixes it and passes the testsuite on GNU/Linux and FreeBSD 11.0-RELEASE. Even though this bug is a regression, this is too late in the gcc-7 process to make a change like this. I'll commit it early for gcc-8 and backport it if it doesn't cause any problems.