diff --git a/libio/Makefile b/libio/Makefile index 4f4dd9f275..08e1e0ec25 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -136,6 +136,7 @@ tests = \ tst-ungetwc1 \ tst-ungetwc2 \ tst-wfile-sync \ + tst-wfiledoallocate-static \ tst-widetext \ tst-wmemstream1 \ tst-wmemstream2 \ @@ -151,7 +152,10 @@ tests = \ tst_wscanf \ # tests -tests-static += tst-stdio-static +tests-static += \ + tst-stdio-static \ + tst-wfiledoallocate-static \ +# tests-static $(objpfx)tst-popen-fork: $(shared-thread-library) diff --git a/libio/tst-wfiledoallocate-static.c b/libio/tst-wfiledoallocate-static.c new file mode 100644 index 0000000000..efbbd0fbc8 --- /dev/null +++ b/libio/tst-wfiledoallocate-static.c @@ -0,0 +1,30 @@ +/* Test static link with function _IO_wfile_doallocate. + Copyright (C) 2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +/* NB: Call main directly to trigger BZ #33935. */ + +int +main (void) +{ + const wchar_t *string = L"Test String."; + (void) wprintf (L"%ls\n", string); + return 0; +} diff --git a/libio/wgenops.c b/libio/wgenops.c index 7a8466ea44..064d71266d 100644 --- a/libio/wgenops.c +++ b/libio/wgenops.c @@ -34,6 +34,8 @@ static int save_for_wbackup (FILE *fp, wchar_t *end_p) __THROW; +libio_static_fn_required (_IO_wfile_doallocate); + /* Return minimum _pos markers Assumes the current get area is the main get area. */ ssize_t