OSDN Git Service

(split) LDP: Update draft and release (from the previous commit)
[linuxjm/LDP_man-pages.git] / release / man3 / scanf.3
index 0c598ff..72278dc 100644 (file)
@@ -94,7 +94,7 @@ glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参
 .RS 4
 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L;
 .br
-or \fIcc \-std=c99\fP
+または \fIcc \-std=c99\fP
 .ad
 .RE
 .SH 説明
@@ -323,30 +323,27 @@ failure)\fP と \fI「一致の失敗」 (matching failure)\fP のいずれか
 これらの関数の Linux 版は \fIGNU\fP \fIlibio\fP ライブラリーを元にしている。 より簡潔な説明には \fIGNU\fP \fIlibc
 (glibc\-1.08)\fP の \fIinfo\fP 文書に目を通すこと。
 .SH 注意
-.SS "The 'a' assignment\-allocation modifier"
-Originally, the GNU C library supported dynamic allocation for string inputs
-(as a nonstandard extension) via the \fBa\fP character.  (This feature is
-present at least as far back as glibc 2.0.)  Thus, one could write the
-following to have \fBscanf\fP()  allocate a buffer for an input string, with a
-pointer to that buffer being returned in \fI*buf\fP:
+.SS "'a' 代入割り当て (assignment\-allocation) 修飾子"
+元々、 GNU C ライブラリ (glibc) では、 \fBa\fP 文字による文字列入力に対する動的割り当て変換指定子 (dynamic
+allocation conversion specifier) を (非標準の拡張として) サポートしている。この機能は少なくとも glibc 2.0
+の時点ではすでに存在している。 したがって、以下のようにして、 \fBscanf\fP()
+に入力文字列に対してバッファを割り当てさせることができる。割り当てられたバッファは \fI*buf\fP で返される。
 
     char *buf;
     scanf("%as", &buf);
 .PP
-The use of the letter \fBa\fP for this purpose was problematic, since \fBa\fP is
-also specified by the ISO C standard as a synonym for \fBf\fP (floating\-point
-input).  POSIX.1\-2008 instead specifies the \fBm\fP modifier for assignment
-allocation (as documented in DESCRIPTION, above).
+この目的で文字 \fBa\fP を使うのは問題をはらんでいる。 なぜなら、 \fBa\fP は ISO C 標準では (浮動小数点入力を表す) の \fBf\fP
+の同義語として定義されているからである。 その代わり、 POSIX.1\-2008 では、(上記の「説明」に書かれている通り)
+代入割り当てを行う修飾子として \fBm\fP が規定されている。
 .PP
 \fBa\fP 修飾子は \fIgcc \-std=c99\fP や \fIgcc \-D_ISOC99_SOURCE\fP でコンパイルしたプログラムでは
 (\fB_GNU_SOURCE\fP も同時に指定していない場合) 利用できない点に注意。この場合、 \fBa\fP は (上述の通り)
 浮動小数点数を示す変換指定子と解釈される。
 
-Support for the \fBm\fP modifier was added to glibc starting with version 2.7,
-and new programs should use that modifier instead of \fBa\fP.
+\fBm\fP 修飾子への対応はバージョン 2.7 以降の glibc で追加されている。新しいプログラムでぇあ \fBa\fP の代わりに \fBm\fP
+を使用すべきである。
 
-As well as being standardized by POSIX, the \fBm\fP modifier has the following
-further advantages over the use of \fBa:\fP
+POSIX で標準化されているだけでなく、 \fBm\fP 修飾子には \fBa\fP を利用する場合に比べて以下のような利点がある。
 .IP * 2
 \fB%c\fP 変換指定子にも適用できる (例えば \fB%3mc\fP)。
 .IP *