Ulf Lamping wrote:
Thomas Anders wrote:a macro definition is different from a simple define, #define ntohl() will *not* affect any g_ntohl() calls! -> no problem here!Joerg Mayer wrote:On Tue, Nov 07, 2006 at 12:57:59PM +0000, LEGO wrote:#define ntohl error() won't work, a g_ntohl would match as well.what about #defining them so they trigger an error?I'm not sure that's true. Have you actually tried?This is a simple approach which seem to be also working for function declarations :-)FWIW, Samba3 is doing something similar for C++ reserved words: (http://viewcvs.samba.org/cgi-bin/viewcvs.cgi/branches/SAMBA_3_0_RELEASE/source/include/includes.h?rev=19018&view=markup) - --- snip --- /* only do the C++ reserved word check when we compile to include --with-developer since too many systems still have comflicts with their header files (e.g. IRIX 6.4) */ #if !defined(__cplusplus) && defined(DEVELOPER) #define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define protected #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define template #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define this #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define new #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define delete #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define friend #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #endif - --- snap ---
[...]
So with the current #include sequence this won't work! Any ideas?
Perl is built for this kind of thing. :-)It requires an extra step, but the code to do it is quite easy, see attached. This program has 2 lists: a list of prohibited APIs that must not be used (or the program will return an error) and a list of deprecated APIs that, if they are used, only generate a warning.
Does Subversion have the concept of a check-in trigger? E.g., before accepting the check-in it runs a script and if the script returns an error, the check-in fails? Could be done there, though that's a bit aggressive ;-).
Or "make codecheck" or something else...Of course the lists I put are just some basics for testing. And maybe the lists need to be different for dissectors vs. core Wireshark, etc., but the concept is there. I even put a Copyright notice in case it's a good enough start. :-)
checkAPIs.pl.gz
Description: GNU Zip compressed data
_______________________________________________ Wireshark-dev mailing list [email protected] http://www.wireshark.org/mailman/listinfo/wireshark-dev
