erroneous scanf's %s pointer description

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

 



Hi,

I have noticed that the description about the %s type modifier in
the official scanf man page is a bit misleading (man3/scanf.3:454). It
currently states "the next pointer must be a pointer to character
array". However the (C99) standard says "the corresponding argument
shall be a pointer to the initial element of a character array".

So IMHO the wording of the man page is sloppy at best - a pointer to an
array is not the same as a pointer to its first element (which can also
obtained by just supplying the name of the array). This led to some
confused students and lecturers here ;)

The man pages of e.g. FreeBSD and Opensolaris contain "the next pointer
must be a pointer to char" and "a pointer to the initial byte of an
array of char" respectively. I have not checked others.

KR
-- 
Dipl.-Ing. Stefan Tauner
Research and Development
Embedded Systems Department

University of Applied Sciences Technikum Wien
Hoechstaedtplatz 6, 1200 Vienna, Austria
T: +43 1 333 40 77-316
E: stefan.tauner@xxxxxxxxxxxxxxxxx
I: embsys.technikum-wien.at
I: www.technikum-wien.at
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux