summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-11-15 17:06:10 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2021-11-15 17:06:10 +0100
commit64e49e7aa4e152ae5d5f097fbe855da199106e57 (patch)
tree057084af932e141f0c302e403f0cf7403b00f286
parent11f273b72614459b0b1754ff0d6d8c4f886161ee (diff)
nonnull.7: srcfix + wfix + ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r--nonnull.721
1 files changed, 11 insertions, 10 deletions
diff --git a/nonnull.7 b/nonnull.7
index 1ba0218..c133692 100644
--- a/nonnull.7
+++ b/nonnull.7
@@ -60,7 +60,7 @@ from all preprocessing translation units composing a conforming program
does not change its meaning (i.e., observable behavior).
.SH NOTES
These rules for
-.B nonnull
+.B \%nonnull
are somewhat of the reverse of
.BR const :
Instead of forbidding the discarding of the qualifier,
@@ -70,7 +70,7 @@ and the danger is in treating a
.B const
as a variable.
Similarly,
-.B nonnull
+.B \%nonnull
pointers are a subset of
.RB (possibly- NULL )
pointers,
@@ -81,25 +81,25 @@ pointers as
pointers.
.SS Prior art
GCC has
-.BR [[gnu::nonnull]] .
+.BR \%[[gnu::nonnull]] .
Why is this better?
.PP
It can be applied more specifically in the case of pointers to pointers.
And, like with
.BR const ,
the
-.BR nonnull -ness
+.BR \%nonnull -ness
can be better enforced by passing the qualifier around.
.PP
However, we recognize the optimizations allowed by
-.BR [[gnu::nonnull]] ,
+.BR \%[[gnu::nonnull]] ,
and also allow them,
by specifying the behavior as undefined
when the qualifier is misused,
as GCC does.
.PP
Clang has
-.BR _Nonnull .
+.BR \%_Nonnull .
Why is this better?
.PP
Clang found that using a qualifier was better than an attribute,
@@ -121,11 +121,11 @@ Even though the language has reserved identifiers
starting with underscore + uppercase
for this kind of keywords,
Clang has already used
-.BR _Nonnull ,
+.BR \%_Nonnull ,
and since we are changing the meaning,
it might cause problems to existing code.
So
-.B nonnull
+.B \%nonnull
seems a better name,
which hopefully is not used by existing code,
or at least it is less used.
@@ -156,7 +156,7 @@ char *nonnull strcpy(char *nonnull restrict dest,
Note that
.I d
need not be
-.BR nonnull -qualified,
+.BR \%nonnull -qualified,
since possibly being
.B NULL
is a superset of not possibly being
@@ -214,10 +214,11 @@ is dereferenced).
.SH AUTHORS
Alejandro Colomar
.UR alx.manpages@gmail.com
+.UE
.PP
I must thank the GCC and Clang programmers
for having provided a solid base
-on which I based this proposal.
+on which I inspired for this proposal.
.SH SEE ALSO
N2731 - 6.7.3
.PP