Bugzilla – Bug 2639
Optimized build fails due to compiler warnings/errors in flow-monitor
Last modified: 2017-01-28 06:13:01 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.
Try with ns-3-dev please. The macros have been removed...