summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-07-10 15:31:59 +0000
committerderaadt <deraadt@openbsd.org>2020-07-10 15:31:59 +0000
commit28fe39c8b64e2a28225dd596f0fbf5248ae68fca (patch)
tree2b545f27d0119961fd58ddcdfe02e1317ee7b0c9 /gnu
parentAs suggested by deraadt@, rewrite most of the printf(3) manual page (diff)
downloadwireguard-openbsd-28fe39c8b64e2a28225dd596f0fbf5248ae68fca.tar.xz
wireguard-openbsd-28fe39c8b64e2a28225dd596f0fbf5248ae68fca.zip
base tree had only two uses of the printf %n format string, in this file.
Appending "%n" to the format string to capture the output-length in bytes (into an uninitialized variable) is exactly the same as using the printf return value. Why did they do this so unnaturally? (normally we don't change gcc import code, but I'm doing a study of %n prevelance) ok millert
Diffstat (limited to 'gnu')
-rw-r--r--gnu/gcc/gcc/genmodes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/gcc/gcc/genmodes.c b/gnu/gcc/gcc/genmodes.c
index 0a70dea23e6..5a91a50edef 100644
--- a/gnu/gcc/gcc/genmodes.c
+++ b/gnu/gcc/gcc/genmodes.c
@@ -787,7 +787,7 @@ calc_wider_mode (void)
#define tagged_printf(FMT, ARG, TAG) do { \
int count_; \
- printf (" " FMT ",%n", ARG, &count_); \
+ count_ = printf (" " FMT ",", ARG); \
printf ("%*s/* %s */\n", 27 - count_, "", TAG); \
} while (0)
@@ -822,7 +822,7 @@ enum machine_mode\n{");
for (m = modes[c]; m; m = m->next)
{
int count_;
- printf (" %smode,%n", m->name, &count_);
+ count_ = printf (" %smode,", m->name);
printf ("%*s/* %s:%d */\n", 27 - count_, "",
trim_filename (m->file), m->line);
}