Ciro Santilli has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/15955 )
Change subject: scons: fix unused auto-generated blob variable in clang
......................................................................
scons: fix unused auto-generated blob variable in clang
Since f2bda876f73af4ecc38406f3562a3d16fd28a5a9, the build system started
adding a length for generated blobs as in:
const std::size_t variable_len = 123;
There were two types of blob files, ones with a header and the ones
without.
The ones with the header, also include the header in the .cc of the blob,
which contains a declaration:
extern const std::size_t variable_len;
Therefore, the ones without header, don't have that extern declaration,
which makes them static according to the C++ standard.
clang then correctly interprets that as problematic due to
-Wunused-const-variable, while GCC does not notice this.
This patch removes the length declaration from the blob files that don't
have the header. Those files currently don't use the length.
Change-Id: I3fc61b28f887fc1015288857328ead2f3b34c6e6
Reviewed-on: https://gem5-review.googlesource.com/c/15955
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/SConscript
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
diff --git a/src/SConscript b/src/SConscript
index 74adf3c..0b66d6a 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -255,7 +255,8 @@
hpp_code('}')
if namespace is not None:
cpp_code('namespace {} {{'.format(namespace))
- cpp_code(symbol_len_declaration + ' = {};'.format(len(data)))
+ if hpp_code is not None:
+ cpp_code(symbol_len_declaration + ' = {};'.format(len(data)))
cpp_code(symbol_declaration + ' = {')
cpp_code.indent()
step = 16
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15955
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I3fc61b28f887fc1015288857328ead2f3b34c6e6
Gerrit-Change-Number: 15955
Gerrit-PatchSet: 2
Gerrit-Owner: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Rutuja Govind Oza <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev