Bug 1374 - [LLVM] error: variable length array of non-POD element type 'Ptr<ns3::UeNetDevice>'
[LLVM] error: variable length array of non-POD element type 'Ptr<ns3::UeNetDe...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: lte
ns-3-dev
All All
: P5 normal
Assigned To: Giuseppe Piro
:
Depends on:
Blocks: 1345
  Show dependency treegraph
 
Reported: 2012-02-22 08:27 UTC by Gustavo J. A. M. Carneiro
Modified: 2012-03-12 10:52 UTC (History)
2 users (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 08:27:21 UTC
../src/lte/examples/lte-multiple-flows.cc:69:22: error: variable length array of non-POD element type 'Ptr<ns3::UeNetDevice>'
  Ptr<UeNetDevice> ue[nbUE];
                     ^
1 error generated.
Comment 1 Gustavo J. A. M. Carneiro 2012-02-22 08:36:20 UTC
diff -r 383bd9261cb9 src/lte/examples/lte-multiple-flows.cc
--- a/src/lte/examples/lte-multiple-flows.cc	Tue Feb 21 11:47:25 2012 +0000
+++ b/src/lte/examples/lte-multiple-flows.cc	Wed Feb 22 13:36:12 2012 +0000
@@ -66,7 +66,7 @@
   Ptr<EnbNetDevice> enb;
   enb = enbDevs.Get (0)->GetObject<EnbNetDevice> ();
 
-  Ptr<UeNetDevice> ue[nbUE];
+  std::vector< Ptr<UeNetDevice> >ue (nbUE);
   for (int i = 0; i < nbUE; i++)
     {
       ue[i] = ueDevs.Get (i)->GetObject<UeNetDevice> ();
Comment 2 Gustavo J. A. M. Carneiro 2012-02-22 08:47:14 UTC
Also this fixes unit tests problems with clang (basically just add parenthesis to around the NS_TEST_ASSERT_MSG_EQ first arg.


diff -r 383bd9261cb9 src/lte/test/lte-propagation-loss-model-test.cc
--- a/src/lte/test/lte-propagation-loss-model-test.cc	Tue Feb 21 11:47:25 2012 +0000
+++ b/src/lte/test/lte-propagation-loss-model-test.cc	Wed Feb 22 13:46:27 2012 +0000
@@ -170,8 +170,8 @@
   int nbOfValues = tx.size ();
   for (int i = 0; i < nbOfValues; i++)
     {
-      NS_TEST_ASSERT_MSG_EQ (tx.at (i) == 0 && rx.at (i) != 0, false, "Problem with elements of tx and rx.");
-      NS_TEST_ASSERT_MSG_EQ (tx.at (i) != 0 && (tx.at (i) <= rx.at (i)), false, "Problem with elements of tx and rx.");
+      NS_TEST_ASSERT_MSG_EQ ((tx.at (i) == 0 && rx.at (i) != 0), false, "Problem with elements of tx and rx.");
+      NS_TEST_ASSERT_MSG_EQ ((tx.at (i) != 0 && (tx.at (i) <= rx.at (i))), false, "Problem with elements of tx and rx.");
     }
Comment 3 Daniel Camara 2012-03-12 10:09:32 UTC
The proposed patch worked for me also.
Comment 4 Daniel Camara 2012-03-12 10:52:59 UTC
fixed in changeset:   7761:db874b5c35f7