[AGENT++] c++ comiler warnings in code from agenpro
Chuck Paterson
cp.snmp++ at twistedbit.com
Thu Nov 9 23:11:29 CET 2006
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
More information about the AGENTPP
mailing list