This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Silently checking whether diagnostics would occur
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Silently checking whether diagnostics would occur
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 14 Sep 2000 20:38:37 +0100 (BST)
- CC: meissner at cygnus dot com, amylaar at pasanda dot cygnus dot co dot uk, gcc at gcc dot gnu dot org, gdr at codesourcery dot com
> 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;