Yu-hsin Wang has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/54064 )
Change subject: systemc: Add -Wno-free-nonheap-object for building
scheduler.cc
......................................................................
systemc: Add -Wno-free-nonheap-object for building scheduler.cc
GCC11 introduces a new warning, free-nonheap-object, which would check
if the code potentially calls delete with a nonheap object. The
scheduler is a global object, and its events members fall to this case.
Here's a simplified example.
https://godbolt.org/z/q6GqEfETa
We think this is a false positive warning, since we set auto delete to
false in the event constructor. To avoid performance penalty, we want to
keep current implementation. As the result, we disable the warning in
the SConscript.
Change-Id: I606ebfdec0af7c78d7bbb336faa1f587caa62855
---
M src/systemc/core/SConscript
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript
index 8805e9b..45bad4f 100644
--- a/src/systemc/core/SConscript
+++ b/src/systemc/core/SConscript
@@ -39,7 +39,6 @@
Source('object.cc')
Source('port.cc')
Source('process.cc')
- Source('scheduler.cc')
Source('sched_event.cc')
Source('sensitivity.cc')
Source('time.cc')
@@ -72,3 +71,11 @@
append['CCFLAGS'] = [flag]
break
Source('sc_time_python.cc', append=append)
+
+ # Disable the false positive warning for the event members of the
scheduler.
+ with gem5_scons.Configure(main) as conf:
+ flag = '-Wno-free-nonheap-object'
+ append = {}
+ if conf.CheckCxxFlag(flag, autoadd=False):
+ append['CCFLAGS'] = [flag]
+ Source('scheduler.cc', append=append)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/54064
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: I606ebfdec0af7c78d7bbb336faa1f587caa62855
Gerrit-Change-Number: 54064
Gerrit-PatchSet: 1
Gerrit-Owner: Yu-hsin Wang <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s