From: Vincent Lefevre <vincent@vinc17.net>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH] man/: Replaced reserved exp identifier
Date: Sat, 12 Jul 2025 23:23:22 +0200 [thread overview]
Message-ID: <20250712212322.GE2629@qaa.vinc17.org> (raw)
In-Reply-To: <yyj5l3eyeppjexobe3mo7m4d3gx75uijklcem5x27e5oda76a7@scxrpc7su4v7>
[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]
Hi Alejandro,
On 2025-07-03 18:28:49 +0200, Alejandro Colomar wrote:
> On Thu, Jul 03, 2025 at 10:17:17AM +0200, Vincent Lefevre wrote:
> > The use of "max" in the name is important as there are several
> > timer expirations and one gives here the maximum number of such
> > expirations. It could also be "max\-expir" or "max\-#expir"[*].
> > What do you think?
>
> How about max-num-expir?
OK.
I've attached a new version of my patch.
> > > > One could do that (this was more or less my initial idea,
> > > > and I'm wondering why the committee chose p).
> > >
> > > The committee has chosen many bad names. Let's not follow them.
> > > Indeed, now that I'm member of the committee, I'm trying to fix that
> > > among other things.
> >
> > Great. FYI, here's what I sent to the CFP list yesterday, as there
> > are also remaining "exp" in the standard:
>
> Do you want me to write a proposal? Or will the CFP write one?
There hasn't been any reaction to my mail in the CFP list.
So perhaps you could write a proposal.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
[-- Attachment #2: reserved-exp-2.patch --]
[-- Type: text/plain, Size: 7887 bytes --]
From d5c365eb0a5c3c14655467e6e528c7360dd5c0a5 Mon Sep 17 00:00:00 2001
From: Vincent Lefevre <vincent@vinc17.net>
Date: Sat, 12 Jul 2025 23:05:00 +0200
Subject: [PATCH] man/: Replaced reserved exp identifier
Since exp is a library function, this is a reserved identifier, which
should not be used as a variable name / parameter.
Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
---
man/man2/timerfd_create.2 | 17 +++++++++--------
man/man3/frexp.3 | 20 ++++++++++----------
man/man3/ldexp.3 | 12 ++++++------
man/man3/scalb.3 | 26 +++++++++++++-------------
man/man3/scalbln.3 | 18 +++++++++---------
5 files changed, 47 insertions(+), 46 deletions(-)
diff --git a/man/man2/timerfd_create.2 b/man/man2/timerfd_create.2
index bcab72f37..7f9d0f039 100644
--- a/man/man2/timerfd_create.2
+++ b/man/man2/timerfd_create.2
@@ -639,12 +639,12 @@ main(int argc, char *argv[])
{
int fd;
ssize_t s;
- uint64_t exp, tot_exp, max_exp;
+ uint64_t expir, tot_expir, max_expir;
struct timespec now;
struct itimerspec new_value;
\&
if (argc != 2 && argc != 4) {
- fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
+ fprintf(stderr, "%s init\-secs [interval\-secs max\-num\-expir]\[rs]n",
argv[0]);
exit(EXIT_FAILURE);
}
@@ -659,10 +659,10 @@ main(int argc, char *argv[])
new_value.it_value.tv_nsec = now.tv_nsec;
if (argc == 2) {
new_value.it_interval.tv_sec = 0;
- max_exp = 1;
+ max_expir = 1;
} else {
new_value.it_interval.tv_sec = atoi(argv[2]);
- max_exp = atoi(argv[3]);
+ max_expir = atoi(argv[3]);
}
new_value.it_interval.tv_nsec = 0;
\&
@@ -676,14 +676,15 @@ main(int argc, char *argv[])
print_elapsed_time();
printf("timer started\[rs]n");
\&
- for (tot_exp = 0; tot_exp < max_exp;) {
- s = read(fd, &exp, sizeof(uint64_t));
+ for (tot_expir = 0; tot_expir < max_expir;) {
+ s = read(fd, &expir, sizeof(uint64_t));
if (s != sizeof(uint64_t))
err(EXIT_FAILURE, "read");
\&
- tot_exp += exp;
+ tot_expir += expir;
print_elapsed_time();
- printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", exp, tot_exp);
+ printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n",
+ expir, tot_expir);
}
\&
exit(EXIT_SUCCESS);
diff --git a/man/man3/frexp.3 b/man/man3/frexp.3
index a741137c2..304095d2b 100644
--- a/man/man3/frexp.3
+++ b/man/man3/frexp.3
@@ -14,9 +14,9 @@ Math library
.nf
.B #include <math.h>
.P
-.BI "double frexp(double " x ", int *" exp );
-.BI "float frexpf(float " x ", int *" exp );
-.BI "long double frexpl(long double " x ", int *" exp );
+.BI "double frexp(double " x ", int *" e );
+.BI "float frexpf(float " x ", int *" e );
+.BI "long double frexpl(long double " x ", int *" e );
.fi
.P
.RS -4
@@ -36,7 +36,7 @@ These functions are used to split the number
.I x
into a
normalized fraction and an exponent which is stored in
-.IR exp .
+.IR e .
.SH RETURN VALUE
These functions return the normalized fraction.
If the argument
@@ -52,20 +52,20 @@ If
.I x
is zero, then the normalized fraction is
zero and zero is stored in
-.IR exp .
+.IR e .
.P
If
.I x
is a NaN,
a NaN is returned, and the value of
-.I *exp
+.I *e
is unspecified.
.P
If
.I x
is positive infinity (negative infinity),
positive infinity (negative infinity) is returned, and the value of
-.I *exp
+.I *e
is unspecified.
.SH ERRORS
No errors occur.
@@ -118,12 +118,12 @@ int
main(int argc, char *argv[])
{
double x, r;
- int exp;
+ int e;
\&
x = strtod(argv[1], NULL);
- r = frexp(x, &exp);
+ r = frexp(x, &e);
\&
- printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, exp, x);
+ printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, e, x);
exit(EXIT_SUCCESS);
}
.EE
diff --git a/man/man3/ldexp.3 b/man/man3/ldexp.3
index c2f5289f3..6bae52c80 100644
--- a/man/man3/ldexp.3
+++ b/man/man3/ldexp.3
@@ -13,9 +13,9 @@ Math library
.nf
.B #include <math.h>
.P
-.BI "double ldexp(double " x ", int " exp );
-.BI "float ldexpf(float " x ", int " exp );
-.BI "long double ldexpl(long double " x ", int " exp );
+.BI "double ldexp(double " x ", int " e );
+.BI "float ldexpf(float " x ", int " e );
+.BI "long double ldexpl(long double " x ", int " e );
.fi
.P
.RS -4
@@ -34,13 +34,13 @@ Feature Test Macro Requirements for glibc (see
These functions return the result of multiplying the floating-point number
.I x
by 2 raised to the power
-.IR exp .
+.IR e .
.SH RETURN VALUE
On success, these functions return
-.IR "x * (2\[ha]exp)" .
+.IR "x * (2\[ha]e)" .
.P
If
-.I exp
+.I e
is zero, then
.I x
is returned.
diff --git a/man/man3/scalb.3 b/man/man3/scalb.3
index 6968931ba..2d1ed17c6 100644
--- a/man/man3/scalb.3
+++ b/man/man3/scalb.3
@@ -15,9 +15,9 @@ Math library
.nf
.B #include <math.h>
.P
-.BI "[[deprecated]] double scalb(double " x ", double " exp );
-.BI "[[deprecated]] float scalbf(float " x ", float " exp );
-.BI "[[deprecated]] long double scalbl(long double " x ", long double " exp );
+.BI "[[deprecated]] double scalb(double " x ", double " e );
+.BI "[[deprecated]] float scalbf(float " x ", float " e );
+.BI "[[deprecated]] long double scalbl(long double " x ", long double " e );
.fi
.P
.RS -4
@@ -47,11 +47,11 @@ by
.B FLT_RADIX
(probably 2)
to the power of
-.IR exp ,
+.IR e ,
that is:
.P
.nf
- x * FLT_RADIX ** exp
+ x * FLT_RADIX ** e
.fi
.P
The definition of
@@ -65,32 +65,32 @@ On success, these functions return
*
.B FLT_RADIX
**
-.IR exp .
+.IR e .
.P
If
.I x
or
-.I exp
+.I e
is a NaN, a NaN is returned.
.P
If
.I x
is positive infinity (negative infinity),
and
-.I exp
+.I e
is not negative infinity,
positive infinity (negative infinity) is returned.
.P
If
.I x
is +0 (\-0), and
-.I exp
+.I e
is not positive infinity, +0 (\-0) is returned.
.P
If
.I x
is zero, and
-.I exp
+.I e
is positive infinity,
a domain error occurs, and
a NaN is returned.
@@ -99,7 +99,7 @@ If
.I x
is an infinity,
and
-.I exp
+.I e
is negative infinity,
a domain error occurs, and
a NaN is returned.
@@ -126,8 +126,8 @@ when calling these functions.
.P
The following errors can occur:
.TP
-Domain error: \f[I]x\f[] is 0, and \f[I]exp\f[] is positive infinity, \
-or \f[I]x\f[] is positive infinity and \f[I]exp\f[] is negative infinity \
+Domain error: \f[I]x\f[] is 0, and \f[I]e\f[] is positive infinity, \
+or \f[I]x\f[] is positive infinity and \f[I]e\f[] is negative infinity \
and the other argument is not a NaN
.I errno
is set to
diff --git a/man/man3/scalbln.3 b/man/man3/scalbln.3
index e14c1be25..1981fdb40 100644
--- a/man/man3/scalbln.3
+++ b/man/man3/scalbln.3
@@ -14,13 +14,13 @@ Math library
.nf
.B #include <math.h>
.P
-.BI "double scalbln(double " x ", long " exp );
-.BI "float scalblnf(float " x ", long " exp );
-.BI "long double scalblnl(long double " x ", long " exp );
+.BI "double scalbln(double " x ", long " e );
+.BI "float scalblnf(float " x ", long " e );
+.BI "long double scalblnl(long double " x ", long " e );
.P
-.BI "double scalbn(double " x ", int " exp );
-.BI "float scalbnf(float " x ", int " exp );
-.BI "long double scalbnl(long double " x ", int " exp );
+.BI "double scalbn(double " x ", int " e );
+.BI "float scalbnf(float " x ", int " e );
+.BI "long double scalbnl(long double " x ", int " e );
.fi
.P
.RS -4
@@ -51,11 +51,11 @@ by
.B FLT_RADIX
(probably 2)
to the power of
-.IR exp ,
+.IR e ,
that is:
.P
.nf
- x * FLT_RADIX ** exp
+ x * FLT_RADIX ** e
.fi
.P
The definition of
@@ -69,7 +69,7 @@ On success, these functions return
*
.B FLT_RADIX
**
-.IR exp .
+.IR e .
.P
If
.I x
--
2.50.0
next prev parent reply other threads:[~2025-07-12 21:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 9:25 [PATCH] man/: Replaced reserved exp identifier Vincent Lefevre
2025-07-02 14:41 ` Alejandro Colomar
2025-07-03 2:34 ` Vincent Lefevre
2025-07-03 2:58 ` Alejandro Colomar
2025-07-03 8:17 ` Vincent Lefevre
2025-07-03 16:28 ` Alejandro Colomar
2025-07-12 21:23 ` Vincent Lefevre [this message]
2025-07-19 13:42 ` Alejandro Colomar
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=20250712212322.GE2629@qaa.vinc17.org \
--to=vincent@vinc17.net \
--cc=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox