From: Alexey Morozov <morozov@novosoft.ru>
To: community@altlinux.ru
Subject: [Comm] А я тут багу в printf(3) нашел :-) (take two)
Date: Tue, 15 Jul 2003 16:54:35 +0700
Message-ID: <200307151639.37828.alex@hop-go.com> (raw)
Выдержка из man 3 printf (секция the field width):
Instead of a decimal digit string one may write `*' or `*m$' (for some
decimal integer m) to specify that the field width is given in the next
argument, or in the m-th argument, respectively, which must be of type int.
Внимание, вопрос:
что согласно этой доке напишет
printf("%0*d %d %d %d\n", 2, 4, 8, 16);
printf("%0*1$d %d %d %d\n", 2, 4, 8, 16);
printf("%0*2$d %d %d %d\n", 2, 4, 8, 16);
?
Полученный мной результат меня несколько удивил (в первую очередь, своей
нелогичностью). Что самое смешное, этот результат совпадает на Linux
(glibc-2.2.6), FreeBSD (4.8-STABLE) и MS Windows 2000 (MS VC++ 6). Я так
понимаю, пора заполнять lawsuit "SCO против всех", в котором говорить, что
printf украден, потому что совместим по багам :-).
P.S. Но в MSDN, по крайней мере, дока про '*' соответствует истине ('*m$' не
задокументирован вовсе)
--
С уважением,
Алексей Морозов
next reply other threads:[~2003-07-15 9:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-15 9:54 Alexey Morozov [this message]
2003-07-15 13:43 ` Alexey Starinsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200307151639.37828.alex@hop-go.com \
--to=morozov@novosoft.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git