Re: [AD] 2 errors encountered in current CVS |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Peter Wang wrote:
> /* for compilers without inline ability, and causes warnings for
> * unused static functions: */
> #define clear(bmp) ((clear_bitmap)(bmp))
But this will still break code with C++ methods named `clear()'. I
really don't think we can use a macro under any circumstances. It's not
nice to get a warning all the time, but IMHO it's even worse to break
people's code every now and then. But I like the idea to make it static,
it seems to solve all problems!
Also, note that under gcc you can do
static __attribute__((unused)) void clear(BITMAP *bmp)
{
clear_bitmap(bmp);
}
to prevent the warning. Under msvc you can use
#pragma warning( disable : 4505 )
This pragma could be optional since people might want the warning for
other static functions. gcc and msvc ought to be the far most important
platforms, and there may be similar #pragmas for other platforms as
well.
Sven