Bug 2639 - Optimized build fails due to compiler warnings/errors in flow-monitor
Optimized build fails due to compiler warnings/errors in flow-monitor
Product: ns-3
Classification: Unclassified
Component: flow-monitor
All Linux
: P3 minor
Assigned To: Tommaso Pecorella
Depends on:
  Show dependency treegraph
Reported: 2017-01-27 20:12 EST by Khaled Y.M.
Modified: 2017-01-28 06:13 EST (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Khaled Y.M. 2017-01-27 20:12:59 EST
When building an optimized version, the build fails because of two issues:
1. signed overflow warning:
In the expansion of IDENT macro defined at the beginning of 'SerializeToXmlStream' implementations in ipv4-flow-classifier.cc and ipv6-flow-classifier.cc. The compiler suspects that their might be a possibility of an overflow and raises a warning.

Suggested fix:
- change the type of 'i' to 'unsigned' instead of 'int', also to avoid having a comparison between signed and unsigned variable, the type of 'ident' should be changed accordingly. Since the function exists as a virtual function in the class FlowClassifier, the same modification to 'indent' has to be done to it as well.

2. cannot instantiate an instance of Ipv4FlowClassifier or Ipv6FlowClassifier in FlowMonitorHelper.
In the function 'GetMonitor' in flow-monitor-helper.cc, Create<Ipv4FlowClassifier>() failed and the compiler raised a warning about instantiating an abstract class, even though the function was implemented. As a work around, I removed 'virtual' from the definition of 'SerializeToXmlStream' in the two classes in question.
Comment 1 Tommaso Pecorella 2017-01-28 06:13:01 EST
Try with ns-3-dev please. The macros have been removed...