ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Alexey Starinsky <staa -at- tavrida -dot- com>
To: Alexey Morozov <community@altlinux.ru>
Subject: Re: [Comm] А я тут багу в printf(3) нашел :-) (take two)
Date: Tue, 15 Jul 2003 16:43:48 +0300
Message-ID: <445124328.20030715164348@tavrida.com> (raw)
In-Reply-To: <200307151639.37828.alex@hop-go.com>

Здравствуйте, Alexey,

Не далее как 15 июля 2003 г., 12:54:35, Вы написали:

AM> Выдержка из man 3 printf (секция the field width):

AM> Instead of a decimal  digit  string one may write `*' or `*m$' (for some 
AM> decimal integer m) to specify that the field width is given in the next 
AM> argument, or in the m-th argument, respectively, which must be of type int.

AM> Внимание, вопрос:

AM> что согласно этой доке напишет

AM> printf("%0*d %d %d %d\n", 2, 4, 8, 16);
AM> printf("%0*1$d %d %d %d\n", 2, 4, 8, 16);
AM> printf("%0*2$d %d %d %d\n", 2, 4, 8, 16);

AM> ?

AM> Полученный мной результат меня несколько удивил (в первую очередь, своей 
AM> нелогичностью). Что самое смешное, этот  результат совпадает на Linux 
AM> (glibc-2.2.6), FreeBSD (4.8-STABLE) и MS Windows 2000 (MS VC++ 6). Я так 
AM> понимаю, пора заполнять lawsuit "SCO против всех", в котором говорить, что 
AM> printf украден, потому что совместим по багам :-).

AM> P.S. Но в MSDN, по крайней мере, дока про '*' соответствует истине ('*m$' не 
AM> задокументирован вовсе)

Мда... попробовали.
И правда, фигня какая-то :)
Задумались...

-- 
С уважением,
Алексей Старинский                         mailto:staa -at- tavrida -dot- com



      reply	other threads:[~2003-07-15 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-15  9:54 Alexey Morozov
2003-07-15 13:43 ` Alexey Starinsky [this message]

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=445124328.20030715164348@tavrida.com \
    --to=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