gcc-11 C++ Regression on Cygwin

James McKelvey mckelveyjw@att.net
Sun May 2 00:02:23 GMT 2021


My code works fine on Cygwin using C++ 10.2.0. But it fails when I build with the latest gcc-11 snapshot,gcc-11-20210426, with undefined references at link time. It fails under -O3 and -O0, with differenterrors. It failed under earlier snapshots as well.

My problem is that I do not know how to report the bug without providing most or all of the project. Or maybe thebug has been reported already? Let me know. I've been away from C++ for several years. Here are the errors for one program:
/usr/local/bin/g++ -std=c++0x  -O3 -DNDEBUG     -DUSE_INTL=1 -DUSE_MUTEX=1  -D_FORTIFY_SOURCE=1 -pedantic-errors -Werror -ansi -fno-common -Wall -Wold-style-cast -Wsign-promo -Wpointer-arith -Wundef -Wwrite-strings -Winvalid-pch -Woverloaded-virtual -Wcast-qual -Wextra -Wredundant-decls -Wshadow -Wcast-align=strict -Wcomment -fstrict-aliasing -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wlogical-op -Wconversion -Wsign-conversion -Wmissing-declarations -Wdeprecated -ftree-switch-conversion -Wuninitialized -Wparentheses -Wimplicit-fallthrough=5 -Wformat-nonliteral -Wformat-truncation=2 -Wformat-signedness -Wdouble-promotion -Wformat=2 -Wformat-overflow=2 -Wformat-security -Wnull-dereference -Wmain -Wmultistatement-macros -Wsequence-point -Wswitch-default -Wswitch-enum -Wunused-value -Wstrict-overflow=2 -Warith-conversion -Wfloat-conversion -Wduplicated-cond -Wunsafe-loop-optimizations -Wreturn-type -Wunused-parameter -Wmaybe-uninitialized -Wstrict-aliasing -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wsuggest-attribute=malloc -Wmissing-format-attribute -Wmissing-noreturn -Walloc-zero -Walloca -Wtrampolines -Wcast-function-type -Wlogical-op -Wpacked -Wredundant-decls -Wunused -Winline -MMD      -fimplicit-templates  -Wl,-warn-common -L.. -o header_edit.exe header_edit.o -lPatternDriver -lintl -lpthread
/usr/bin/ld: header_edit.o:header_edit.cc:(.text.startup+0x2e2): undefined reference to `

_ZN13PatternDriver12BreakPatternC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_26ConflateIntegerScalarValueESB_RKNS_12TemplateEnumIL_ZNS_16complement_namesB5cxx11EEL_ZNS_14COMPLEMENTENUMEEEE

'
/usr/bin/ld: header_edit.o:header_edit.cc:(.text.startup+0x3a1): undefined reference to `

_ZN13PatternDriver12BreakPatternC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_26ConflateIntegerScalarValueESB_RKNS_12TemplateEnumIL_ZNS_16complement_namesB5cxx11EEL_ZNS_14COMPLEMENTENUMEEEE

'
/usr/bin/ld: header_edit.o:header_edit.cc:(.text.startup+0x3d2): undefined reference to `E

'
/usr/bin/ld: header_edit.o:header_edit.cc:(.text.startup+0x3f8): undefined reference to `leE'
/usr/bin/ld: header_edit.o:header_edit.cc:(.text.startup+0x431): undefined reference to `gnE'
/usr/bin/ld: header_edit.o:header_edit.cc:(.text.startup+0x449): undefined reference to `S3_'




More information about the Gcc-help mailing list