Bug 1050 - ISO C++ forbids variable length array
ISO C++ forbids variable length array
Status: NEW
Product: ns-3
Classification: Unclassified
Component: general
ns-3-dev
All All
: P5 trivial
Assigned To: John Abraham
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-03 06:08 EST by John Abraham
Modified: 2011-08-10 13:10 EDT (History)
5 users (show)

See Also:


Attachments
Patch againist wimax modules (786 bytes, patch)
2011-04-18 03:17 EDT, Quincy Tse
Details | Diff
Patch against tap-bridge (1.65 KB, patch)
2011-04-18 03:18 EDT, Quincy Tse
Details | Diff
Patch against applications module (1.67 KB, patch)
2011-04-18 03:21 EDT, Quincy Tse
Details | Diff
Patch againist dsdv modules (647 bytes, patch)
2011-04-18 03:22 EDT, Quincy Tse
Details | Diff
Patch againist emu modules (1.65 KB, patch)
2011-04-18 03:22 EDT, Quincy Tse
Details | Diff
Patch againist internet modules (3.93 KB, patch)
2011-04-18 03:25 EDT, Quincy Tse
Details | Diff
Patch againist network modules (4.05 KB, patch)
2011-04-18 03:25 EDT, Quincy Tse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Abraham 2011-02-03 06:08:30 EST
We have several instances where we use array declarations similar to
int i = 5 ;
int array[i]; 

rather than 
int array[5];

This raises portability concerns. It was discovered while I ported the basic simulator to native Windows. (Visual C++ with Windows API support treats them as errors).

Using "-ansi -pedantic" flags in "wscript" during compilation we see warnings such as 
../src/internet-stack/icmpv6-header.cc:1011: warning: ISO C++ forbids variable length array ‘data’
Comment 1 Quincy Tse 2011-04-18 03:17:26 EDT
Created attachment 1074 [details]
Patch againist wimax modules
Comment 2 Quincy Tse 2011-04-18 03:18:31 EDT
Created attachment 1075 [details]
Patch against tap-bridge
Comment 3 Quincy Tse 2011-04-18 03:20:17 EDT
Comment on attachment 1074 [details]
Patch againist wimax modules

(sorry - wrong bug)
Comment 4 Quincy Tse 2011-04-18 03:21:23 EDT
Created attachment 1076 [details]
Patch against applications module
Comment 5 Quincy Tse 2011-04-18 03:22:08 EDT
Created attachment 1077 [details]
Patch againist dsdv modules
Comment 6 Quincy Tse 2011-04-18 03:22:47 EDT
Created attachment 1078 [details]
Patch againist emu modules
Comment 7 Quincy Tse 2011-04-18 03:25:00 EDT
Created attachment 1079 [details]
Patch againist internet modules
Comment 8 Quincy Tse 2011-04-18 03:25:51 EDT
Created attachment 1080 [details]
Patch againist network modules
Comment 9 Mathieu Lacage 2011-08-10 12:55:38 EDT
(In reply to comment #5)
> Created attachment 1077 [details]
> Patch againist dsdv modules

patch does not look like it has much to do with variable length arrays. makes tests fail.
Comment 10 Mathieu Lacage 2011-08-10 12:56:42 EDT
(In reply to comment #2)
> Created attachment 1075 [details]
> Patch against tap-bridge

patch buggy: controllen is initialized to incorrect value. i.e., sizeof() gives different values. same for emu patch below.
Comment 11 Mathieu Lacage 2011-08-10 13:10:13 EDT
partially applied: changeset: 91df05070541

It's fascinating to see this patch make some wholly unrelated olsr/dsdv tests fail.