Bug 1371 - [LLVM] error: struct 'TestCase' was previously declared as a class
[LLVM] error: struct 'TestCase' was previously declared as a class
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
All All
: P5 normal
Assigned To: Mathieu Lacage
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-22 06:28 UTC by Gustavo J. A. M. Carneiro
Modified: 2012-02-24 03:47 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2012-02-22 06:28:41 UTC
../src/core/model/test.cc:226:3: error: struct 'TestCase' was previously declared as a class [-Werror,-Wmismatched-tags]
  struct TestCase *current = m_parent;
  ^~~~~~
  class
In file included from ../src/core/model/test.cc:19:
../src/core/model/test.h:834:7: note: previous use is here
class TestCase
      ^
1 error generated.
Comment 1 Gustavo J. A. M. Carneiro 2012-02-22 08:54:47 UTC
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'
Comment 2 Mathieu Lacage 2012-02-24 03:39:25 UTC
changeset 0ee272dab97b
Comment 3 Mathieu Lacage 2012-02-24 03:47:37 UTC
changeset: fcf4778c9b16