Hi,

"Robert P. J. Day" <[EMAIL PROTECTED]> writes:

>   i'm clarifying the meaning and usage of the gcc attributes used in
> the kernel source tree, and i noticed that the gcc manual defines the
> "format" attribute as having four possible archetypes: printf, scanf,
> strftime or strfmon.
>
>   however, it seems that there's no real difference between the
> archetypes printf and scanf:
>
>   int printf(const char *format, ...);
>   int scanf(const char *format, ...);
>
> so is there a reason why someone would use one over the other?

#include <stdio.h>

int main(void)
{
        int n;

        scanf ("%d",   &n);
        printf("%d\n",  n);

        return 0;
}

scanf expects different types for equivalent format strings.

        Hannes

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to