gn: remove gcc override
PATCH 1/1 gn: remove gcc override
When compiling gn with clang, the following errors are being seen (with qemuarm64-secureboot machine, possibly others):
In file included from /usr/include/c++/12/string:40,
from ../sources/gn-0+git/src/base/strings/string_number_conversions.h:11,
from ../sources/gn-0+git/src/gn/operators.cc:10:
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:202:17:/usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
354 | __c1 = __c2;
| ^~~~
../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
198 | std::string empty_def;
| ^~~~~~~~~
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:205:17:/usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
354 | __c1 = __c2;
| ^~~~
../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
198 | std::string empty_def;
| ^~~~~~~~~cc1plus: all warnings being treated as errors
Remove the toolchain-gcc override to allow the cflag -Wno-error=maybe-uninitialized to be applied.
--- meta/recipes-devtools/gn/gn_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gn/gn_git.bb +1 -1
@@ -49,4 +49,4 @@ BBCLASSEXTEND = "native" COMPATIBLE_HOST = "^(?!riscv32).*" -CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized" +CFLAGS:append = " -Wno-error=maybe-uninitialized"
Signature · 1 line
2.39.5
Quoted 105 lines · Jon Mason via lists.openembedded.org
When compiling gn with clang, the following errors are being seen (with
qemuarm64-secureboot machine, possibly others):In file included from
/usr/include/c++/12/string:40,
from ../sources/gn-0+git/src/base/strings/string_number_conversions.h:11, from ../sources/gn-0+git/src/gn/operators.cc:10:
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’, inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::_S_copy(_CharT*, const _CharT*,size_type) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.h:421:23,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT,_Traits, _Allocator>& std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::_M_replace(size_type,size_type, const _CharT*,size_type) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.tcc:532:22,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT,_Traits, _Alloc>& std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::assign(const _CharT*) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.h:1647:19,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT,_Traits, _Alloc>& std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::operator=(const _CharT*) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.h:815:28,
inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn- 0+git/src/gn/operators.cc:202:17:/usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
354 |__c1=__c2;
| ^~~~ ../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
198 |std::stringempty_def;
| ^~~~~~~~~
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’, inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::_S_copy(_CharT*, const _CharT*,size_type) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.h:421:23,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT,_Traits, _Allocator>& std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::_M_replace(size_type,size_type, const _CharT*,size_type) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.tcc:532:22,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT,_Traits, _Alloc>& std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::assign(const _CharT*) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.h:1647:19,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT,_Traits, _Alloc>& std::__cxx11::basic_string<_CharT,_Traits, _Alloc>::operator=(const _CharT*) [with_CharT= char;_Traits= std::char_traits<char>;_Alloc= std::allocator<char>]’ at/usr/include/c++/12/bits/basic_string.h:815:28,
inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn- 0+git/src/gn/operators.cc:205:17:/usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
354 |__c1=__c2;
| ^~~~ ../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
198 |std::stringempty_def;
| ^~~~~~~~~
cc1plus: all warnings being treated as errorsRemove the toolchain-gcc override to allow the cflag -Wno-error=maybe-uninitialized to be applied.
Signed-off-by Jon Mason <[email protected]>---
meta/recipes-devtools/gn/gn_git.bb | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes- renamed from meta/recipes-devtools/gn/gn_git.bb +0
-0devtools/gn/gn_git.bb
indexd8896609b193..2443ea7139f4100644meta/recipes-devtools/gn/gn_git.bb +0
-0@@ -49,4 +49,4 @@ BBCLASSEXTEND = "native"
COMPATIBLE_HOST = "^(?!riscv32).*"
meta/recipes-devtools/gn/gn_git.bb BBCLASSEXTEND = "native" · line 52
Quoted 2 lines
meta/recipes-devtools/gn/gn_git.bb +1
-1-CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized" +CFLAGS:append = " -Wno-error=maybe-uninitialized"
In that case can you drop the append and just make it a += please?
Cheers,
Richard