福間@福岡 です。 記事 <19990827085934K.eguchi / shizuokanet.ne.jp> にて、 EGUCHI Osamu <eguchi / shizuokanet.ne.jp> さんは書きました: > SunOS-4.1.4-JLE の man 3 printf によると、 > > [> 書式指定文字列には番号付きの引数指定(すなわち、 %digit$ ) > [> と番号無しの引数指定(すなわち、 % と * )のどちらも使うこと > [> ができますが、両方を同時に使うことはできません。両方の指定を > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > [> 混 在 された場合の結果は不定です。番号付き引数指定の場合、 n > [> 番目の引数を指定するためには、それ以前の( 1 番目から (n-1) > [> 番目までの)引数が存在しなくてはなりません。 > > だそうですので、この領域の動作にこだわる必要は無いようです。 FreeBSD(-current) の printf(3) でも | o An optional field, consisting of a decimal digit string followed by a | $, specifying the next argument to access . If this field is not | provided, the argument following the last argument accessed will be | used. Arguments are numbered starting at 1. If unaccessed arguments | in the format string are interspersed with ones that are accessed the | results will be indeterminate. ですね。 で、安直に The Single UNIX Specification http://www.unix-systems.org/online.html をあたってみましたが、やはり「混在した場合の挙動は未定義」とあります。 ということで、あまり気にする必要はないんじゃないでしょうか。 # だといいなぁ…。 --- Yasuhiro Fukuma (福間 康弘) as Yasu.F @ Kitakyushu.Fukuoka.Japan Web site: http://www8.big.or.jp/~yasuf/ PGP fingerprint = 17 25 8A F3 99 E5 7E 19 C0 EA 6E 03 8A C3 CE F0 “今月の目標: 「盗聴に注意しましょう」”