Bug 2639

Summary: Optimized build fails due to compiler warnings/errors in flow-monitor
Product: ns-3 Reporter: Khaled Y.M. <kld_at7>
Component: flow-monitorAssignee: Tommaso Pecorella <tommaso.pecorella>
Status: NEEDINFO ---    
Severity: minor CC: ns-bugs
Priority: P3    
Version: ns-3.26   
Hardware: All   
OS: Linux   

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...