Bugzilla – Bug 930
examples/topology-read/topology-example-sim.cc uses variable length array
Last modified: 2010-08-10 23:23:50 UTC
topology-example-sim.cc uses variable length array, which cannot be compiled using some compilers (especially strict standards-compilent compilers like clang). Variable length array is part of C99 but does not comply with C++ standards (not in C++98, rejected for C++0x).
Created attachment 902 [details] Proposed patch.
Are we making a decision here to say no to variable-length arrays in ns-3?
(In reply to comment #2) > Are we making a decision here to say no to variable-length arrays in ns-3? I slightly lean towards this because it is not standard and there are other viable solutions in C++ (such as new[] or std::vector). If no other comments from developers I suggest to apply the patch and add this statement to the coding style: "variable-length arrays are not standards-compliant C++; use instead std::vector, std::string, or operator new[] when your code might call for a variable-length array."
changeset: caa2dd9bbbce I also updated the webpage, changeset: f27e0846b0c4