aboutsummaryrefslogtreecommitdiffstats
path: root/man3/stdarg.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/stdarg.3')
-rw-r--r--man3/stdarg.328
1 files changed, 13 insertions, 15 deletions
diff --git a/man3/stdarg.3 b/man3/stdarg.3
index fd9e32a5e5..08245eb8b6 100644
--- a/man3/stdarg.3
+++ b/man3/stdarg.3
@@ -157,23 +157,23 @@ An obvious implementation would have a
be a pointer to the stack frame of the variadic function.
In such a setup (by far the most common) there seems
nothing against an assignment
-.RS
+.in +4n
.nf
- va_list aq = ap;
+va_list aq = ap;
.fi
-.RE
+.in
Unfortunately, there are also systems that make it an
array of pointers (of length 1), and there one needs
-.RS
+.in +4n
.nf
- va_list aq;
- *aq = *ap;
+va_list aq;
+*aq = *ap;
.fi
-.RE
+.in
Finally, on systems where parameters are passed in registers,
it may be necessary for
.BR va_start ()
@@ -187,16 +187,16 @@ can free the allocated memory again.
To accommodate this situation, C99 adds a macro
.BR va_copy (),
so that the above assignment can be replaced by
-.RS
+.in +4n
.nf
- va_list aq;
- va_copy(aq, ap);
- ...
- va_end(aq);
+va_list aq;
+va_copy(aq, ap);
+...
+va_end(aq);
.fi
-.RE
+.in
Each invocation of
.BR va_copy ()
must be matched by a corresponding invocation of
@@ -274,7 +274,6 @@ The function
.I foo
takes a string of format characters and prints out the argument associated
with each format character based on the type.
-.RS
.nf
#include <stdio.h>
@@ -308,4 +307,3 @@ foo(char *fmt, ...)
va_end(ap);
}
.fi
-.RE