Menu

#975 5.4.2.1: Fixed several VS2005 compiler warnings

closed
None
5
2012-11-09
2009-03-16
No

Fixed the following categories of compiler warnings:
- Unused variables.
- Implicit conversion of T* to uchar*.
- Implicit conversion from int or long to u_short.
- Calls to functions declared in io.h or winstub.h without including the appropriate header file.
- Declaring a function pointer as Netsnmp_Trap_Handler instead of Netsnmp_Trap_Handler*.
This patch has been tested on Windows XP with the Visual Studio 2005 compiler.

Discussion

  • Magnus Fromreide

    Quite interesting changes in this patch.
    I will talk about them from a 5.5 point of view.

    * The change to agent/agent_trap.c is already applied.
    * The change to agent/mibgroup/agentx/protocol.c is already applied.

    * The change to agent/mibgroup/agent/extend.c becomes irrelevant as
    the argument type of snmp_set_var_value is changed to const void*.

    * The change to apps/snmpnetstat/inet.c is correct.
    * The changes to apps/snmptrapd_handlers.[ch] are correct.

    * The change to apps/snmptrapd_log.c is interesting but as I don't know how
    interpret contextEngineID I will refrain from saying anything.
    It is noteworthy that the code seems to treat contextEngineID as an octet
    string and not an OID everywhere but at the place you changed so I suspect
    that it really is an octet string.

    * The added include files is nothing I have anything to say about.

    I intend to apply the changes I have listed as correct to trunk as of tomorrow unless someone complains about it.

    /MF

     
  • Dave Shield

    Dave Shield - 2009-04-08

    I've only had a quick look at the patch, but I can confirm that snmpEngineID is a (binary) string value rather than an OID.
    The relevant code fragment looks suspiciously like an erroneous cut-n-paste from the case immediately above.

     
  • Wes Hardaker

    Wes Hardaker - 2009-04-22

    snmpEngineIDs aren't OIDs so that code is wrong (you were right to cast it if it was a problem, but the problem is worse than a cast can fix ;-). I've applied the other remaining pieces that are correct to various branches in SVN and am closing the patch. I'll either fix the issue with the engineIDs or file a new bug report on it.

     

Log in to post a comment.