[AGENT++] c++ comiler warnings in code from agenpro

Frank Fock fock at agentpp.com
Mon Nov 13 00:47:05 CET 2006


Hi Chuck,

I will try to change the code generation templates
for the next release, so that for the unsigned values
the >=0 case will be no longer checked.

Until then I would recommend ignoring the warning.

Best regards,
Frank

Chuck Paterson wrote:
> The build environment I am trying to generate code for
> typically has -Wall -Werror. I am trying to build
> some test code to get a feel for how agenpro and agent++ all
> fit together. When trying to compile code generated in mib.cpp
> I get
> 
> ../../src/HealthSystem/snmp/test/if_mib.cpp: In member function ‘virtual 
> int Agentpp::if_mib_ifAlias::prepare_set_request(Agentpp::Request*, int&)’:
> ../../src/HealthSystem/snmp/test/if_mib.cpp:696: warning: comparison of 
> unsigned expression >= 0 is always true
> 
> Which is from
> 
>         if (!(((v.len() >= 0) && (v.len() <= 64))))
>                  return SNMP_ERROR_WRONG_LENGTH;
> 
> Which I believe was generated from
> 
> cpp_code.vm:((v.len() >= $range.lowerValue) && (v.len() <= 
> $range.upperValue))#end))
> 
> 
> I'm wondering how people deal with this in general.
> 
> 1)  Just ignore the warnings
> 2)  edit the offending line after code generation
> 3)  ???
> 
> 
> Worst comes to worst I can turn off the -Werror.
> 
> 
> 
> Thanks
> Chuck
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list