Commit 75f4922
committed
Static assertions cleanup
Because we added StaticAssertStmt() first before StaticAssertDecl(),
some uses as well as the instructions in c.h are now a bit backwards
from the "native" way static assertions are meant to be used in C.
This updates the guidance and moves some static assertions to better
places.
Specifically, since the addition of StaticAssertDecl(), we can put
static assertions at the file level. This moves a number of static
assertions out of function bodies, where they might have been stuck
out of necessity, to perhaps better places at the file level or in
header files.
Also, when the static assertion appears in a position where a
declaration is allowed, then using StaticAssertDecl() is more native
than StaticAssertStmt().
Reviewed-by: John Naylor <john.naylor@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/941a04e7-dd6f-c0e4-8cdf-a33b3338cbda%40enterprisedb.com1 parent 2613dec commit 75f4922
File tree
29 files changed
+99
-104
lines changed- src
- backend
- access
- heap
- nbtree
- transam
- backup
- catalog
- executor
- libpq
- port
- storage
- lmgr
- page
- utils
- adt
- cache
- mmgr
- common
- include
- access
- catalog
- common
- storage
29 files changed
+99
-104
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5783 | 5783 | | |
5784 | 5784 | | |
5785 | 5785 | | |
5786 | | - | |
5787 | | - | |
5788 | | - | |
5789 | | - | |
5790 | 5786 | | |
5791 | 5787 | | |
5792 | 5788 | | |
| |||
7921 | 7917 | | |
7922 | 7918 | | |
7923 | 7919 | | |
7924 | | - | |
| 7920 | + | |
7925 | 7921 | | |
7926 | 7922 | | |
7927 | 7923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
2489 | | - | |
2490 | | - | |
2491 | | - | |
2492 | | - | |
2493 | | - | |
2494 | | - | |
2495 | | - | |
2496 | 2489 | | |
2497 | 2490 | | |
2498 | 2491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3883 | 3883 | | |
3884 | 3884 | | |
3885 | 3885 | | |
3886 | | - | |
3887 | | - | |
3888 | | - | |
3889 | | - | |
3890 | | - | |
3891 | | - | |
3892 | | - | |
3893 | | - | |
3894 | | - | |
3895 | 3886 | | |
3896 | 3887 | | |
3897 | 3888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
| 373 | + | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| |||
1745 | 1745 | | |
1746 | 1746 | | |
1747 | 1747 | | |
1748 | | - | |
| 1748 | + | |
1749 | 1749 | | |
1750 | 1750 | | |
1751 | 1751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
194 | 200 | | |
195 | 201 | | |
196 | 202 | | |
| |||
2550 | 2556 | | |
2551 | 2557 | | |
2552 | 2558 | | |
2553 | | - | |
2554 | | - | |
2555 | | - | |
2556 | | - | |
2557 | | - | |
2558 | | - | |
2559 | 2559 | | |
2560 | 2560 | | |
2561 | 2561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
| 499 | + | |
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1443 | 1443 | | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | | - | |
| 1446 | + | |
1447 | 1447 | | |
1448 | 1448 | | |
1449 | 1449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
| |||
3117 | 3123 | | |
3118 | 3124 | | |
3119 | 3125 | | |
3120 | | - | |
3121 | | - | |
3122 | | - | |
3123 | | - | |
3124 | | - | |
3125 | | - | |
3126 | 3126 | | |
3127 | 3127 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
0 commit comments