|
Unused Parameters
Submitted by |
I like to compile my projects with the highest warning levels, and I often
find myself with a number of warnings regarding "unreferenced formal
parameters". There are other ways of handling it, but I like this one (at
least until someone points out something horrible about it):
template <typename t
inline void dhUnusedParameter(t p_t){
p_t;
} |
At the beginning of WinMain I can put:
dhUnusedParameter(p_prev_instance); |
Which not only stops the warning, but also clearly documents that the
parameter really isn't being used.
Stay Casual,
Ken
Drunken Hyena
This tip was updated on 06 March 2002.
|
The zip file viewer built into the Developer Toolbox made use
of the zlib library, as well as the zlibdll source additions.
|