Tom Rollet has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/48843 )
Change subject: scons: fix hook for 'deprecated' attribute
......................................................................
scons: fix hook for 'deprecated' attribute
On the new release, the compilation is polluted by the same warning:
> ''deprecated' attribute directive ignored
It seems that the hook added in this patch does not work:
https://gem5-review.googlesource.com/c/public/gem5/+/45246/1..7
The snippet of code compile with TryCompile on g++{8,9}.
It probably comes from the fact that the compilation
only creates a warning and not an error.
By adding temporarily '-Werror' for this compilation test,
it filters the faulty gcc versions.
Change-Id: I2b8b7a1a7e06df437b76e98d212947f4f9452311
---
M src/base/SConsopts
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/base/SConsopts b/src/base/SConsopts
index ea11bd4..a773f1c 100644
--- a/src/base/SConsopts
+++ b/src/base/SConsopts
@@ -56,11 +56,16 @@
# alternative stacks.
conf.env['HAVE_VALGRIND'] = conf.CheckCHeader('valgrind/valgrind.h')
+ # Check if the compiler supports the [[gnu::deprecated]] attribute
+ # -Werror is temporarly added to make the compilation fail on warning
+ main.Append(CCFLAGS=['-Werror'])
conf.env['HAVE_DEPRECATED_NAMESPACE'] = conf.TryCompile('''
int main() {return 0;}
namespace [[gnu::deprecated("Test namespace deprecation")]]
test_deprecated_namespace {}
''', '.cc')
+ main['CCFLAGS'].remove('-Werror')
+
if not conf.env['HAVE_DEPRECATED_NAMESPACE']:
warning("Deprecated namespaces are not supported by this
compiler.\n"
"Please make sure to check the mailing list for
deprecation "
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48843
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I2b8b7a1a7e06df437b76e98d212947f4f9452311
Gerrit-Change-Number: 48843
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Rollet <tom.rol...@huawei.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s