[Bug middle-end/88175] Showing header file instead of source code line for uninitialized variable

jg at jguk dot org gcc-bugzilla@gcc.gnu.org
Fri Nov 23 22:42:00 GMT 2018


--- Comment #4 from Jonny Grant <jg at jguk dot org> ---
Also, it is "copy" that is unused uninitialized? (not "temp")

The line carat is also incorrect I believe, it should be header.cpp:10:12 ?

So would be better if it was as follows:

$ g++ -O2 -Werror=uninitialized -o header header.cpp
header.cpp: In function ‘void test(info_t)’:
header.cpp:10:12: error: ‘copy.info::registered’ is used uninitialized in this
function [-Werror=uninitialized]
     temp = copy;
cc1plus: some warnings being treated as errors

More information about the Gcc-bugs mailing list