any reason for the usage of "__attribute__((format(scanf..."?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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?  i
mean, other than that one might be defining an actual variant of
scanf() for which scanf would make more sense, it seems that most uses
use the printf archetype in the kernel tree.  is there an actual
underlying difference between those two in this context?  or are they
interchangeable?

rday
--


========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux