aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-08-28 14:11:06 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-08-31 02:30:21 +0200
commit9c9a5acaa29342313f5f7c14ba42d55ebca79a04 (patch)
treed2173973cfe39694193a72d5a40306eb35879e99
parent15af0ac10ab85d26f12a5ad162583a184282b6a3 (diff)
downloadman-pages-9c9a5acaa29342313f5f7c14ba42d55ebca79a04.tar.gz
operator.7: Fix precedence of the 'cast operator'
Unary operators are mentioned in C11::6.5.3, and casts are in C11::6.5.4 (they are mentioned in order of precedence). And from note 85 (in section 6.5) in that same C11 standard, major subsections 6.5.X are sorted by precedence. As an example (from Jakub), `sizeof(int)+1` is interpreted as `(sizeof(int))+1`, and not `sizeof((int)+1)`. I used C11 and not C18 (the latest) because at least in the draft copy of C18 that I have, there are a few important typos in that section, while the draft copy of C11 that I have is free of those typos. And C11 and C18 are almost identical, with no major changes to the language. Reported-by: David Sletten <david.paul.sletten@gmail.com> Cc: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man7/operator.73
1 files changed, 2 insertions, 1 deletions
diff --git a/man7/operator.7 b/man7/operator.7
index b0bac5f4ee..22c107c7f4 100644
--- a/man7/operator.7
+++ b/man7/operator.7
@@ -48,7 +48,8 @@ lb lb lb
l l l.
Operator Associativity Notes
() [] \-> . ++ \-\- left to right [1]
-! \(ti ++ \-\- + \- (type) * & sizeof right to left [2]
+! \(ti ++ \-\- + \- * & sizeof right to left [2]
+(type) right to left
* / % left to right
+ \- left to right
<< >> left to right