changeset a3cf30302e19 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=a3cf30302e19
description:
        sim: Remove test for non-NULL this in Event

        The method Event::initialized() tests if this != NULL as a part of the
        expression that tests if an event is initialized. The only case when
        this check could be false is if the method is called on a null
        pointer, which is illegal and leads to undefined behavior (such as
        eating your pets) according to the C++ standard. Because of this,
        modern compilers (specifically, recent versions of clang) warn about
        this which we treat as an error. This changeset removes the redundant
        check to fix said warning.

diffstat:

 src/sim/eventq.hh |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r e2716d523716 -r a3cf30302e19 src/sim/eventq.hh
--- a/src/sim/eventq.hh Tue Feb 03 14:25:47 2015 -0500
+++ b/src/sim/eventq.hh Tue Feb 03 14:25:48 2015 -0500
@@ -239,7 +239,7 @@
     bool
     initialized() const
     {
-        return this && (flags & InitMask) == Initialized;
+        return (flags & InitMask) == Initialized;
     }
 
   protected:
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to