Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-cpp-sdk-core-tests/utils/CacheTest.cpp error: 'out' may be used uninitialized #2234

Closed
thomas-roos opened this issue Dec 7, 2022 · 7 comments
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@thomas-roos
Copy link

thomas-roos commented Dec 7, 2022

Describe the bug

when building with yocto (master) and tests enabled i get an build errror

Expected Behavior

compile sdk without warning

Current Behavior

| [1793/1904] /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-g++ -DAWS_AUTH_USE_IMPORT_EXPORT -DAWS_CAL_USE_IMPORT_EXPORT -DAWS_CHECKSUMS_USE_IMPORT_EXPORT -DAWS_COMMON_USE_IMPORT_EXPORT -DAWS_COMPRESSION_USE_IMPORT_EXPORT -DAWS_CRT_CPP_USE_IMPORT_EXPORT -DAWS_EVENT_STREAM_USE_IMPORT_EXPORT -DAWS_HTTP_USE_IMPORT_EXPORT -DAWS_
IO_USE_IMPORT_EXPORT -DAWS_MQTT_USE_IMPORT_EXPORT -DAWS_MQTT_WITH_WEBSOCKETS -DAWS_S3_USE_IMPORT_EXPORT -DAWS_SDKUTILS_USE_IMPORT_EXPORT -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=10 -DAWS_SDK_VERSION_PATCH=22 -DAWS_USE_EPOLL -DENABLE_CURL_CLIENT -DENABLE_OPENSSL_ENCRYPTION -DHAS_PATHCONF -DHAS_UMASK -DPLATFORM_LINUX -I/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resour
ces/include -I/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external -I/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core/include -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/ubuntu/yocto
/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fmacro-prefix-map=/home/u
buntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/build=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/build=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot=  -fmacro-prefix-map=/home/ubuntu/yocto/build/tmp/work/c
ore2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot=  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden -Wno-deprecated-declarations -DNDEBUG -fno-exceptions -std=c++11 -Wall -Werror -pedantic -Wextra -DS2N_KYBER512R3_AVX2_BMI2 -DS2N_STACKTRACE -DS2N_CPUID_AVAILABLE -DS2N_FEATURES_AVAILABLE -fPIC -DS2N_FALL_THROUGH_SUP
PORTED -DS2N___RESTRICT__SUPPORTED -DS2N_MADVISE_SUPPORTED -DS2N_CLONE_SUPPORTED -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD5_SHA1_HASH -DS2N_LIBCRYPTO_SUPPORTS_EVP_RC4 -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX -MD -MT aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o -MF aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o.d -o aws-cpp-sdk-core-tests/CMakeFiles/
aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o -c /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp                                    
| FAILED: aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o                                                                                                                       
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-g++ -DAWS_AUTH_USE_IMPORT_EXPORT -DAWS_CAL_USE_IMPORT_EXPORT -DAWS_CHECKSUMS_USE_IMPORT_EXPORT -DAWS_COMMON_USE_IMPORT_EXPORT -DAWS_COMPRESSION_USE_IMPORT_EXPORT -DAWS_CRT_CPP_USE_IMPORT_EXPORT -DAWS_EVENT_STREAM_USE_IMPORT_EXPORT -DAWS_HTTP_USE_IMPORT_EXPORT -DAWS_IO_USE_IMPOR
T_EXPORT -DAWS_MQTT_USE_IMPORT_EXPORT -DAWS_MQTT_WITH_WEBSOCKETS -DAWS_S3_USE_IMPORT_EXPORT -DAWS_SDKUTILS_USE_IMPORT_EXPORT -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=10 -DAWS_SDK_VERSION_PATCH=22 -DAWS_USE_EPOLL -DENABLE_CURL_CLIENT -DENABLE_OPENSSL_ENCRYPTION -DHAS_PATHCONF -DHAS_UMASK -DPLATFORM_LINUX -I/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include 
-I/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external -I/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core/include -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/ubuntu/yocto/build/tmp/w
ork/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fmacro-prefix-map=/home/ubuntu/yocto/
build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/build=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/build=/usr/src/debug/aws-sdk-cpp/1.10.22-r0  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot=  -fmacro-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky
-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot=  -fdebug-prefix-map=/home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden -Wno-deprecated-declarations -DNDEBUG -fno-exceptions -std=c++11 -Wall -Werror -pedantic -Wextra -DS2N_KYBER512R3_AVX2_BMI2 -DS2N_STACKTRACE -DS2N_CPUID_AVAILABLE -DS2N_FEATURES_AVAILABLE -fPIC -DS2N_FALL_THROUGH_SUPPORTED -DS2N
___RESTRICT__SUPPORTED -DS2N_MADVISE_SUPPORTED -DS2N_CLONE_SUPPORTED -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD5_SHA1_HASH -DS2N_LIBCRYPTO_SUPPORTS_EVP_RC4 -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX -MD -MT aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o -MF aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o.d -o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-
core-tests.dir/utils/CacheTest.cpp.o -c /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp                                                
| In file included from /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest.h:55,                                                                                                                                                                                                                                                                      
|                  from /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp:6:                                                             
| In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>]',                                                                                                                                                                                                                                             
|     inlined from 'static void testing::internal::internal_stream_operator_without_lexical_name_lookup::StreamPrinter::PrintValue(const T&, std::ostream*) [with T = float; <template-parameter-1-2> = void; <template-parameter-1-3> = std::basic_ostream<char>&]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:216:9,
|     inlined from 'void testing::internal::PrintWithFallback(const T&, std::ostream*) [with T = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:311:22,                                                                                                                                                                     
|     inlined from 'void testing::internal::PrintTo(const T&, std::ostream*) [with T = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:440:30,                                                                                                                                                                               
|     inlined from 'static void testing::internal::UniversalPrinter<T>::Print(const T&, std::ostream*) [with T = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:702:12,                                                                                                                                                     
|     inlined from 'void testing::internal::UniversalPrint(const T&, std::ostream*) [with T = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:999:30,                                                                                                                                                                        
|     inlined from 'static void testing::internal::UniversalTersePrinter<T>::Print(const T&, std::ostream*) [with T = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:884:19,                                                                                                                                                
|     inlined from 'std::string testing::PrintToString(const T&) [with T = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:1037:44,                                                                                                                                                                                          
|     inlined from 'static std::string testing::internal::FormatForComparison<ToPrint, OtherOperand>::Format(const ToPrint&) [with ToPrint = float; OtherOperand = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:333:42,                                                                                                   
|     inlined from 'std::string testing::internal::FormatForComparisonFailureMessage(const T1&, const T2&) [with T1 = float; T2 = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:414:51,                                                                                                                                    
|     inlined from 'testing::AssertionResult testing::internal::CmpHelperEQFailure(const char*, const char*, const T1&, const T2&) [with T1 = float; T2 = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest.h:1343:70,                                                                                                                    
|     inlined from 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = float; T2 = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest.h:1362:69,                                                                                                                           
|     inlined from 'static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = float; T2 = float; typename std::enable_if<((! std::is_integral<_Tp>::value) || (! std::is_pointer<_T2>::value))>::type* <anonymous> = 0]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/testing-resources/include/aws/external/gtest/gtest.h
:1377:64,                                                                                                
|     inlined from 'virtual void CacheTests_TestPutWithSameKey_Test::TestBody()' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp:82:5:                                                                                                                                                                                                                  
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/recipe-sysroot/usr/include/c++/12.2.0/ostream:228:25: error: 'out' may be used uninitialized [-Werror=maybe-uninitialized]                                                                                                                                                                                                                              
|   228 |         return _M_insert(static_cast<double>(__f));                                            
|       |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~                                             
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp: In member function 'virtual void CacheTests_TestPutWithSameKey_Test::TestBody()':                                                                                                                                                                                                                       
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.22-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp:80:11: note: 'out' was declared here                                                                                                                                                                                                                                                                     
|    80 |     float out;                                                                                 
|       |           ^~~                                                                                  
| cc1plus: all warnings being treated as errors                                                          
| [1794/1904] : && /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aw

Reproduction Steps

yocto + meta-aws 
(master branch)
and this recipe aws-sdk-cpp_1.10.22.bb: 
SUMMARY = "AWS C++ SDK"
DESCRIPTION = "AWS C++ SDK and ptest"
HOMEPAGE = "https://github.com/aws/aws-sdk-cpp"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"

DEPENDS += "\
    aws-c-auth \
    aws-crt-cpp \
    curl \
"

SRC_URI = "\
    git://github.com/aws/aws-sdk-cpp.git;protocol=https;branch=main \
    file://0002-build-fix-building-without-external-dependencies.patch"

SRCREV = "6eb7b90bc0d59d072473969d513aa707d1ab02d8"

S = "${WORKDIR}/git"

inherit cmake ptest pkgconfig

PACKAGECONFIG ??= "\
    shared \
    ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
    ${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}"

PACKAGECONFIG[pulseaudio] = "-DPULSEAUDIO=TRUE, -DPULSEAUDIO=FALSE, pulseaudio"

PACKAGECONFIG[with-tests] = "-DENABLE_TESTING=ON -DAUTORUN_UNIT_TESTS=ON,-DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF, googletest"

python populate_packages:prepend () {
    # Put the libraries into separate packages
    do_split_packages(d, d.expand('${libdir}'), r'^lib(.*)\.so$', '%s', 'aws-sdk-cpp library for %s', extra_depends='', prepend=True)
}

PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"

# Notify that libraries are not versioned
FILES_SOLIBSDEV = ""

# -Werror will cause deprecation warnings to fail the build e.g. OpenSSL cause one, so disable these warnings
OECMAKE_CXX_FLAGS += "-Wno-deprecated-declarations "

EXTRA_OECMAKE += "\
     -DBUILD_DEPS=OFF \
"

Possible Solution

suppress error works, but might this is a real issue

Additional Information/Context

No response

AWS CPP SDK version used

1.10.22

Compiler and Version used

x86_64-poky-linux-g++ (GCC) 12.2.0

Operating System and version

yocto master on ubuntu 22.04.

@thomas-roos thomas-roos added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 7, 2022
@jmklix
Copy link
Member

jmklix commented Dec 20, 2022

Does it build without any problems when you disable the tests while building?

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Dec 20, 2022
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Dec 23, 2022
@thomas-roos
Copy link
Author

thomas-roos commented Dec 23, 2022

Greetings!
yes, the bug is still there with 1.10.37

|     inlined from 'static std::string testing::internal::FormatForComparison<ToPrint, OtherOperand>::Format(cons
t ToPrint&) [with ToPrint = float; OtherOperand = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linu
x/aws-sdk-cpp/1.10.37-r0/git/testing-resources/include/aws/external/gtest/gtest-printers.h:333:42,
|     inlined from 'std::string testing::internal::FormatForComparisonFailureMessage(const T1&, const T2&) [with 
T1 = float; T2 = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.37-r0/git/test
ing-resources/include/aws/external/gtest/gtest-printers.h:414:51,
|     inlined from 'testing::AssertionResult testing::internal::CmpHelperEQFailure(const char*, const char*, cons
t T1&, const T2&) [with T1 = float; T2 = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk
-cpp/1.10.37-r0/git/testing-resources/include/aws/external/gtest/gtest.h:1343:70,
|     inlined from 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, 
const T2&) [with T1 = float; T2 = float]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.
10.37-r0/git/testing-resources/include/aws/external/gtest/gtest.h:1362:69,
|     inlined from 'static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*
, const T1&, const T2&) [with T1 = float; T2 = float; typename std::enable_if<((! std::is_integral<_Tp>::value) |
| (! std::is_pointer<_T2>::value))>::type* <anonymous> = 0]' at /home/ubuntu/yocto/build/tmp/work/core2-64-poky-l
inux/aws-sdk-cpp/1.10.37-r0/git/testing-resources/include/aws/external/gtest/gtest.h:1377:64,
|     inlined from 'virtual void CacheTests_TestPutWithSameKey_Test::TestBody()' at /home/ubuntu/yocto/build/tmp/
work/core2-64-poky-linux/aws-sdk-cpp/1.10.37-r0/git/aws-cpp-sdk-core-tests/utils/CacheTest.cpp:82:5:
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.37-r0/recipe-sysroot/usr/include/c++/12.
2.0/ostream:228:25: error: 'out' may be used uninitialized [-Werror=maybe-uninitialized]
|   228 |         return _M_insert(static_cast<double>(__f));
|       |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.37-r0/git/aws-cpp-sdk-core-tests/utils/C
acheTest.cpp: In member function 'virtual void CacheTests_TestPutWithSameKey_Test::TestBody()':
| /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.37-r0/git/aws-cpp-sdk-core-tests/utils/C
acheTest.cpp:80:11: note: 'out' was declared here
|    80 |     float out;
|       |           ^~~
| cc1plus: all warnings being treated as errors
| [868/1656] /home/ubuntu/yocto/build/tmp/work/core2-64-poky-linux/aws-sdk-cpp/1.10.37-r0/recipe-sysroot-native/u
sr/bin/x86_64-poky-linux/x86_64-poky-linux-g++ -DAWS_

of course I can not build those failing libs: #2242
but when I suppress the warning, it builds: -Wno-maybe-uninitialized

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. labels Dec 24, 2022
@chloe-zh
Copy link

I think I have seen similar issue when compile with gcc 12

@chloe-zh
Copy link

chloe-zh commented Apr 21, 2023

Saw the same warning in my environment:

Platform: Amazon Linux
GCC version: 12.2.0
SDK version: 1.11.x

[90/121] Building CXX object tests/aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o
FAILED: tests/aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/CacheTest.cpp.o 

{removed some logs}

    inlined from ‘virtual void CacheTests_TestPutWithSameKey_Test::TestBody()’ at aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/utils/CacheTest.cpp:82:5:
{removed path prefix}/build/gcc-12.2.0/include/c++/12.2.0/ostream:228:25: error: ‘out’ may be used uninitialized [-Werror=maybe-uninitialized]
  228 |         return _M_insert(static_cast<double>(__f));
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/utils/CacheTest.cpp: In member function ‘virtual void CacheTests_TestPutWithSameKey_Test::TestBody()’:
aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/utils/CacheTest.cpp:80:11: note: ‘out’ was declared here
   80 |     float out;
      |           ^~~
cc1plus: all warnings being treated as errors

@sbiscigl
Copy link
Contributor

Cleaning up some issues i fixed this issue in Fix gcc 12 uninitialized warning #2546. Resolving, give a shout if you see this pop up again.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

4 participants