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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54064
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
1 file changed