From: Sergey I. Y. <ev...@na...> - 2000-11-22 14:43:29
|
Hi, I'm porting ucd-snmp to OS/2. During porting process some questions appeared and I'd like to know your opinions about it. First of all I'd like to have this port included with main distribution. How this can be done? Other issues are more technical: 1. I have found that entire package completely ignores possible problems with function calling convention used by different compilers. Although this unlikely a problem in most unixes, this may cause serious problems when parts of package compiled by one compiler while other parts with other. This issue can be resolved by adding to all function prototypes, function pointer members in structures and typedefs some symbol which may be defined to nothing on unix platforms or to something specific on OS/2 and Win32 (it also may suffer from this problem). Something like this: typedef int (*CALL_CONV snmp_callback) (int, struct snmp_session *, int, struct snmp_pdu *, void *); void CALL_CONV snmpv3_authtype_conf(const char *word, char *cptr); 2. Similar issue with alignment of structures. Although there is no standard way to accomplish this, I think that most current compilers recognizes and able to handle correctly #pragma pack() In either case compilers that don't recognize this pragma will just ignore it and nothing bad happens. If to use this approach then each header will have (snmpv3.h used as an example): #ifndef SNMPV3_H #define SNMPV3_H #pragma pack(1) at the beginning and #pragma pack() #endif /* SNMPV3_H */ at the end. Comments and opinions are welcome. Thanks. Regards, Sergey. *-------------------------------------- ES@Home |