https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117348
Bug ID: 117348 Summary: genmatch.cc:597:13: error: 'fmemopen' was not declared in this sco pe; did you mean 'freopen'? Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: danglin at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- Host: hppa64-hp-hpux11.11 Target: hppa64-hp-hpux11.11 Build: hppa64-hp-hpux11.11 /home/dave/gnu/gcc/objdir64/./prev-gcc/xg++ -B/home/dave/gnu/gcc/objdir64/./prev -gcc/ -B/opt/gnu64/gcc/gcc-15/hppa64-hp-hpux11.11/bin/ -nostdinc++ -B/home/dave/ gnu/gcc/objdir64/prev-hppa64-hp-hpux11.11/libstdc++-v3/src/.libs -B/home/dave/gn u/gcc/objdir64/prev-hppa64-hp-hpux11.11/libstdc++-v3/libsupc++/.libs -I/home/da ve/gnu/gcc/objdir64/prev-hppa64-hp-hpux11.11/libstdc++-v3/include/hppa64-hp-hpux 11.11 -I/home/dave/gnu/gcc/objdir64/prev-hppa64-hp-hpux11.11/libstdc++-v3/inclu de -I/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++ -L/home/dave/gnu/gcc/objdir6 4/prev-hppa64-hp-hpux11.11/libstdc++-v3/src/.libs -L/home/dave/gnu/gcc/objdir64/ prev-hppa64-hp-hpux11.11/libstdc++-v3/libsupc++/.libs -c -g -O2 -fno-checking -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno -error=narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wcondit ionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-ma cros -Wno-overlength-strings -Werror -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibu ild -I../../gcc/gcc -I../../gcc/gcc/build -I../../gcc/gcc/../include -I../../gc c/gcc/../libcpp/include -DGENMATCH_SELFTESTS \ -o build/genmatch.o ../../gcc/gcc/genmatch.cc ../../gcc/gcc/genmatch.cc: In function 'void test_diag_vfprintf(const char*, const char*, ...)': ../../gcc/gcc/genmatch.cc:597:13: error: 'fmemopen' was not declared in this scope; did you mean 'freopen'? 597 | FILE *f = fmemopen (buf, 256, "w"); | ^~~~~~~~ | freopen In autohost.h, we have: /* Define to 1 if we found a declaration for 'fmemopen', otherwise define to 0. */ #ifndef USED_FOR_TARGET #define HAVE_DECL_FMEMOPEN 0 #endif Check for fmemopen is wrong: #if defined(GENMATCH_SELFTESTS) && defined(HAVE_DECL_FMEMOPEN)