Silently checking whether diagnostics would occur

Joern Rennecke amylaar@cygnus.co.uk
Thu Sep 14 12:37:00 GMT 2000


> One nit with passing in a function is that attribute printf doesn't
> work on function pointers IIRC, so all the calls to the warning
> function ptr would lose format checks.  (Though I suppose that could
> be fixed.)  Sigh, that would have been cleaner since I could do
> "#pragma poison warning" to make sure the function pointer parameter
> was always used in preference to `warning'.

You could have an inline function that is used to dereference the function
pointer.

INLINE void dispatch_warning PARAMS ((void (*fun)(), const char *fmt, ...)) ATTRIBUTE_PRINTF_2;


More information about the Gcc mailing list