forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit05cbd6c
committed
Swap order of extern/static and pg_nodiscard
When pg_nodiscard was first added, the C standard draft had it as afunction specifier, and so the code comment about placement waswritten with that in mind. The final C23 standard has it as anattribute and the placement rules are a bit different for that.Specifically, it needs to be before extern or static. (Or at leastboth current clang and gcc require that.) So just swap these. (To beclear: The current implementation with gcc attributes doesn't care.This change is just for maximum forward compatibility for non-gcccompilers.) This also keeps the order consistent with the previouslyintroduced pg_noreturn. Also update the code comment to reflect thementioned developments since its introduction.Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://www.postgresql.org/message-id/flat/pxr5b3z7jmkpenssra5zroxi7qzzp6eswuggokw64axmdixpnk@zbwxuq7gbbcw1 parent01261fb commit05cbd6c
6 files changed
+45
-45
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
138 |
| - | |
139 |
| - | |
140 |
| - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
15 |
| - | |
| 14 | + | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
|
Lines changed: 34 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
608 | 608 |
| |
609 | 609 |
| |
610 | 610 |
| |
611 |
| - | |
612 |
| - | |
613 |
| - | |
614 |
| - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
615 | 615 |
| |
616 |
| - | |
617 |
| - | |
618 |
| - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
619 | 619 |
| |
620 |
| - | |
621 |
| - | |
622 |
| - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
623 | 623 |
| |
624 |
| - | |
625 |
| - | |
| 624 | + | |
| 625 | + | |
626 | 626 |
| |
627 |
| - | |
| 627 | + | |
628 | 628 |
| |
629 | 629 |
| |
630 | 630 |
| |
631 | 631 |
| |
632 | 632 |
| |
633 | 633 |
| |
634 | 634 |
| |
635 |
| - | |
636 |
| - | |
637 |
| - | |
638 |
| - | |
639 |
| - | |
640 |
| - | |
641 |
| - | |
642 |
| - | |
643 |
| - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
644 | 644 |
| |
645 | 645 |
| |
646 | 646 |
| |
| |||
657 | 657 |
| |
658 | 658 |
| |
659 | 659 |
| |
660 |
| - | |
661 |
| - | |
662 |
| - | |
663 |
| - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
664 | 664 |
| |
665 |
| - | |
666 |
| - | |
667 |
| - | |
668 |
| - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
669 | 669 |
| |
670 | 670 |
| |
671 | 671 |
| |
672 | 672 |
| |
673 | 673 |
| |
674 | 674 |
| |
675 |
| - | |
676 |
| - | |
677 |
| - | |
678 |
| - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
679 | 679 |
| |
680 | 680 |
| |
681 | 681 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 |
| - | |
| 41 | + | |
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
444 | 444 |
| |
445 | 445 |
| |
446 | 446 |
| |
447 |
| - | |
| 447 | + | |
448 | 448 |
| |
449 | 449 |
| |
450 | 450 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 |
| - | |
83 |
| - | |
| 82 | + | |
| 83 | + | |
84 | 84 |
| |
85 |
| - | |
| 85 | + | |
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
| |||
110 | 110 |
| |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
| 113 | + | |
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
|
0 commit comments
Comments
(0)