wpa_supplicant: if printf is a macro, #ifdefs inside are not good

Jouni Malinen j
Tue Jan 13 00:07:51 PST 2009

On Mon, Jan 12, 2009 at 11:42:09PM +0100, Cristian Ionescu-Idbohrn wrote:
> I got this patch from one of my knowlegeable colleagues.  Thoughts?
> Comments?
> -	printf("%s\n\n%s\n"
> +	/* Printf can be a macro, but no preprocessor directives are
> +	   allowed in a macro parameter list.  However, printf is
> +	   required to also exist as a function, so let's force it to
> +	   not being recognized as a macro with parameters. */
> +	(printf)("%s\n\n%s\n"

Is this referring to wpa_supplicant/main.c and the first printf() call
in usage()? What is so special about that particular printf()? Where is
the '#ifdef' that is referenced on the Subject line and what is the
purpose of the printf macro? I have some problems trying to figure out
what exactly is the issue that this is trying to resolve..

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list