Re: libstdc++ build error: ‘__val_a’ may be used uninitialized [-Werror=maybe-uninitialized]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 18 Jan 2024 at 11:42, Saifi Khan <saifi.khan@xxxxxxxxx> wrote:
>
> Hi:
>
> Building gcc from the 'main' branch (4a8430c8c) and get this error during the 'libstdc++' automated build.
>
> Short of using '-Wno-error=maybe-uninitialized' is there any other approach that can be adopted ?

What options are you using that turn on -Werror in the first place?

>
> ...
> Making all in c++23
> make[6]: Entering directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++23'
> /bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include   -fno-checking -I/opt/gcc/src/libstdc++-v3/../libgcc -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/opt/gcc/src/libstdc++-v3/libsupc++   -std=gnu++23 -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -fran
>  dom-seed=stacktrace.lo  -fimplicit-templates -g -O2 -pipe -D_GNU_SOURCE -fcf-protection -mshstk -c -o stacktrace.lo /opt/gcc/src/libstdc++-v3/src/c++23/stacktrace.cc
> /bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include   -fno-checking -I/opt/gcc/src/libstdc++-v3/../libgcc -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/opt/gcc/src/libstdc++-v3/libsupc++   -std=gnu++23 -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -fran
>  dom-seed=print.lo  -fimplicit-templates -g -O2 -pipe -D_GNU_SOURCE -fcf-protection -mshstk -std=gnu++26 -c /opt/gcc/src/libstdc++-v3/src/c++23/print.cc
> libtool: compile:  /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -I/opt/gcc/src/libstdc++-v3/../libgcc -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/opt/gcc/src/libstdc++-v3/libsupc++ -std=gnu++23 -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=print.lo -fimplicit-templates -g -O2 -pipe -D_GNU_SOURCE -fcf
>  -protection -mshstk -std=gnu++26 -c /opt/gcc/src/libstdc++-v3/src/c++23/print.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o print.o
> libtool: compile:  /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -I/opt/gcc/src/libstdc++-v3/../libgcc -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/opt/gcc/src/libstdc++-v3/libsupc++ -std=gnu++23 -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=stacktrace.lo -fimplicit-templates -g -O2 -pipe -D_GNU_SOURCE
>   -fcf-protection -mshstk -c /opt/gcc/src/libstdc++-v3/src/c++23/stacktrace.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o stacktrace.o
> /bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=link /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include   -fno-checking -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/../libvtv/.libs -Wl,--rpath -Wl,/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/../libvtv/.libs -Wl,-O1 -Wl,-z,relro -Wl,--gc-sections  -std=gnu++23 -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -frandom-seed=libc++23convenience.la
>    -fimplicit-templates  -o libc++23convenience.la  stacktrace.lo print.lo
> libtool: link: ar --plugin /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/liblto_plugin.so --plugin /opt/gcc/build/./gcc/liblto_plugin.so rc .libs/libc++23convenience.a  stacktrace.o print.o
> libtool: link: ranlib --plugin /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/liblto_plugin.so --plugin /opt/gcc/build/./gcc/liblto_plugin.so .libs/libc++23convenience.a
> libtool: link: ( cd ".libs" && rm -f "libc++23convenience.la" && ln -s "../libc++23convenience.la" "libc++23convenience.la" )
> make[6]: Leaving directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++23'
> Making all in c++26
> make[6]: Entering directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++26'
> /bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include   -fno-checking -I/opt/gcc/src/libstdc++-v3/../libgcc -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/opt/gcc/src/libstdc++-v3/libsupc++   -std=gnu++26 -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -fran
>  dom-seed=text_encoding.lo  -fimplicit-templates -g -O2 -pipe -D_GNU_SOURCE -fcf-protection -mshstk -c -o text_encoding.lo /opt/gcc/src/libstdc++-v3/src/c++26/text_encoding.cc
> libtool: compile:  /opt/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/gcc/build/./gcc -nostdinc++ -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -I/opt/gcc/src/libstdc++-v3/../libgcc -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/opt/gcc/src/libstdc++-v3/libsupc++ -std=gnu++26 -D_GLIBCXX_SHARED -fno-implicit-templates -fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -Werror -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=text_encoding.lo -fimplicit-templates -g -O2 -pipe -D_GNU_SOU
>  RCE -fcf-protection -mshstk -c /opt/gcc/src/libstdc++-v3/src/c++26/text_encoding.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o text_encoding.o
> In file included from /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/text_encoding:44,
>                  from /opt/gcc/src/libstdc++-v3/src/c++26/text_encoding.cc:25:
> In function ‘constexpr bool std::__unicode::__charset_alias_match(std::string_view, std::string_view)’,
>     inlined from ‘static constexpr bool std::text_encoding::_S_comp(std::string_view, std::string_view)’ at /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/text_encoding:445:46,
>     inlined from ‘static constexpr const std::text_encoding::_Rep* std::text_encoding::_S_find_name(std::string_view)’ at /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/text_encoding:461:13,
>     inlined from ‘constexpr std::text_encoding::text_encoding(std::string_view)’ at /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/text_encoding:344:26,
>     inlined from ‘std::text_encoding std::__locale_encoding(const char*)’ at /opt/gcc/src/libstdc++-v3/src/c++26/text_encoding.cc:47:27:
> /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unicode.h:1099:14: error: ‘__val_a’ may be used uninitialized [-Werror=maybe-uninitialized]
>  1099 |         else if (__val_a != __val_b)
>       |              ^~
> /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unicode.h: In function ‘std::text_encoding std::__locale_encoding(const char*)’:
> /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unicode.h:1087:23: note: ‘__val_a’ was declared here
>  1087 |         unsigned char __val_a, __val_b;
>       |                       ^~~~~~~
> In function ‘constexpr bool std::__unicode::__charset_alias_match(std::string_view, std::string_view)’,
>     inlined from ‘bool std::text_encoding::_M_is_environment() const’ at /opt/gcc/src/libstdc++-v3/src/c++26/text_encoding.cc:73:42:
> /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unicode.h:1099:14: error: ‘__val_a’ may be used uninitialized [-Werror=maybe-uninitialized]
>  1099 |         else if (__val_a != __val_b)
>       |              ^~
> /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unicode.h: In member function ‘bool std::text_encoding::_M_is_environment() const’:
> /opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unicode.h:1087:23: note: ‘__val_a’ was declared here
>  1087 |         unsigned char __val_a, __val_b;
>       |                       ^~~~~~~
> cc1plus: all warnings being treated as errors
> make[6]: *** [Makefile:562: text_encoding.lo] Error 1
> make[6]: Leaving directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++26'
> make[5]: *** [Makefile:797: all-recursive] Error 1
> make[5]: Leaving directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src'
> make[4]: *** [Makefile:577: all-recursive] Error 1
> make[4]: Leaving directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3'
> make[3]: *** [Makefile:502: all] Error 2
> make[3]: Leaving directory '/opt/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3'
> make[2]: *** [Makefile:17687: all-stage1-target-libstdc++-v3] Error 2
> make[2]: Leaving directory '/opt/gcc/build'
> make[1]: *** [Makefile:25945: stage1-bubble] Error 2
> make[1]: Leaving directory '/opt/gcc/build'
> make: *** [Makefile:1100: all] Error 2
> make[1]: Entering directory '/opt/gcc/build'
> /bin/sh /opt/gcc/src/mkinstalldirs /opt/gcc /opt/gcc
> make[2]: Entering directory '/opt/gcc/build/fixincludes'
> make[2]: *** No rule to make target 'install'.  Stop.
> make[2]: Leaving directory '/opt/gcc/build/fixincludes'
> make[1]: *** [Makefile:4171: install-fixincludes] Error 2
> make[1]: Leaving directory '/opt/gcc/build'
> make: *** [Makefile:2690: install] Error 2
>
> All suggestions are welcome.
>
> warm regards
> Saifi.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux