This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Silently checking whether diagnostics would occur


> 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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]