Closed as duplicate
Description
Steps to reproduce:
- In a mingw-w64 shell under MSYS2, run
make test.
Expected output: No compiler warnings and tests passed.
Actual output:
MINGW64 $ make test
g++ -Wall -Wextra -pedantic -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wundef -Wno-multichar -Wold-style-cast -std=c++0x -g -c test.cpp
g++ -Wall -Wextra -pedantic -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wundef -Wno-multichar -Wold-style-cast -std=c++0x -g -c simplecpp.cpp
simplecpp.cpp: In function 'std::string getTimeDefine(const tm*)':
simplecpp.cpp:3443:34: warning: unknown conversion type character 'T' in format [-Wformat=]
3443 | strftime(buf, sizeof(buf), "%T", timep);
| ^
g++ -g simplecpp.o test.o -o testrunner
g++ -Wall -Wextra -pedantic -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wundef -Wno-multichar -Wold-style-cast -std=c++0x -g -c main.cpp
g++ -g main.o simplecpp.o -o simplecpp
# The -std=c++03 makes sure that simplecpp.cpp is C++03 conformant. We don't require a C++11 compiler
g++ -std=c++03 -fsyntax-only simplecpp.cpp
./testrunner
------ assertion failed ---------
line 2746
expected:10
actual:2
------ assertion failed ---------
line 2749
expected:1
actual:0
------ assertion failed ---------
line 2750
expected:1
actual:0
------ assertion failed ---------
line 2751
expected:58
actual:-107
------ assertion failed ---------
line 2752
expected:1
actual:0
------ assertion failed ---------
line 2753
expected:1
actual:0
------ assertion failed ---------
line 2754
expected:58
actual:0
------ assertion failed ---------
line 2755
expected:1
actual:0
------ assertion failed ---------
line 2756
expected:1
actual:0
------ assertion failed ---------
line 2757
expected:34
actual:0
make: *** [Makefile:16: test] Error 1
GCC warns for undefined format specifier %T in strftime. timeDefine tests in testrunner fail.
Metadata
Metadata
Assignees
Labels
No labels
Activity
firewave commentedon Jun 12, 2025
Thanks for the reproducer (I failed at that). Duplicate of #391 though.
__TIME__replacement might be empty depending on compiler #391