File tree 3 files changed +6
-17
lines changed
3 files changed +6
-17
lines changed Original file line number Diff line number Diff line change 21
21
22
22
/*
23
23
* ExceptionalCondition - Handles the failure of an Assert()
24
- *
25
- * Note: this can't actually return, but we declare it as returning int
26
- * because the TrapMacro() macro might get wonky otherwise.
27
24
*/
28
- int
25
+ void
29
26
ExceptionalCondition (const char * conditionName ,
30
27
const char * errorType ,
31
28
const char * fileName ,
@@ -55,6 +52,4 @@ ExceptionalCondition(const char *conditionName,
55
52
#endif
56
53
57
54
abort ();
58
-
59
- return 0 ;
60
55
}
Original file line number Diff line number Diff line change @@ -1507,15 +1507,9 @@ pg_re_throw(void)
1507
1507
errfinish (0 );
1508
1508
}
1509
1509
1510
- /* We mustn 't return... */
1510
+ /* Doesn 't return ... */
1511
1511
ExceptionalCondition ("pg_re_throw tried to return" , "FailedAssertion" ,
1512
1512
__FILE__ , __LINE__ );
1513
-
1514
- /*
1515
- * Since ExceptionalCondition isn't declared noreturn because of
1516
- * TrapMacro(), we need this to keep gcc from complaining.
1517
- */
1518
- abort ();
1519
1513
}
1520
1514
1521
1515
Original file line number Diff line number Diff line change @@ -655,14 +655,14 @@ extern PGDLLIMPORT bool assert_enabled;
655
655
/*
656
656
* TrapMacro is the same as Trap but it's intended for use in macros:
657
657
*
658
- * #define foo(x) (AssertMacro(x != 0) && bar(x))
658
+ * #define foo(x) (AssertMacro(x != 0), bar(x))
659
659
*
660
660
* Isn't CPP fun?
661
661
*/
662
662
#define TrapMacro (condition , errorType ) \
663
663
((bool) ((! assert_enabled) || ! (condition) || \
664
664
(ExceptionalCondition(CppAsString(condition), (errorType), \
665
- __FILE__, __LINE__))))
665
+ __FILE__, __LINE__), 0 )))
666
666
667
667
#ifndef USE_ASSERT_CHECKING
668
668
#define Assert (condition )
@@ -683,8 +683,8 @@ extern PGDLLIMPORT bool assert_enabled;
683
683
Trap(!(condition), "BadState")
684
684
#endif /* USE_ASSERT_CHECKING */
685
685
686
- extern int ExceptionalCondition (const char * conditionName ,
686
+ extern void ExceptionalCondition (const char * conditionName ,
687
687
const char * errorType ,
688
- const char * fileName , int lineNumber );
688
+ const char * fileName , int lineNumber ) __attribute__(( noreturn )) ;
689
689
690
690
#endif /* POSTGRES_H */
You can’t perform that action at this time.
0 commit comments