[Ns-bugs] [Bug 1371] [LLVM] error: struct 'TestCase' was previously declared as a class

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Wed Feb 22 05:54:47 PST 2012


https://www.nsnam.org/bugzilla/show_bug.cgi?id=1371

--- Comment #1 from Gustavo J. A. M. Carneiro <gjcarneiro at gmail.com> 2012-02-22 08:54:47 EST ---
Also this is needed to make clang happy:

diff -r 6b9082bd091b src/core/model/test.h
--- a/src/core/model/test.h    Wed Feb 22 13:51:28 2012 +0000
+++ b/src/core/model/test.h    Wed Feb 22 13:52:07 2012 +0000
@@ -45,7 +45,7 @@
   do {                                          \
     if (MustAssertOnFailure ())                 \
       {                                         \
-        *(int *)0 = 0;                          \
+        *(volatile int *)0 = 0;                 \
       }                                         \
   } while (false)

To fix this error:


../src/wimax/test/wimax-fragmentation-test.cc:113:11: error: indirection of
non-volatile null pointer will be deleted, not trap
      [-Werror,-Wnull-dereference]
          NS_TEST_EXPECT_MSG_EQ (((type >> 2) & 1), 1, "The packet is not a
fragment");
         
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/wimax/test/wimax-fragmentation-test.cc:23:
./ns3/test.h:230:3: note: instantiated from:
  NS_TEST_EXPECT_MSG_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__)
  ^
./ns3/test.h:189:9: note: instantiated from:
        ASSERT_ON_FAILURE;                                              \
        ^
./ns3/test.h:48:9: note: instantiated from:
        *(int *)0 = 0;                          \
        ^~~~~~~~~
../src/wimax/test/wimax-fragmentation-test.cc:113:11: note: consider using
__builtin_trap() or qualifying pointer with 'volatile'

-- 
Configure bugmail: https://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Ns-bugs mailing list