8000 Add noreturn attributes to some error reporting functions · postgrespro/postgres@0cb1fac · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0cb1fac

Browse files
committed
Add noreturn attributes to some error reporting functions
1 parent 62401db commit 0cb1fac

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

contrib/cube/cubescan.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ float ({integer}|{real})([eE]{integer})?
6060

6161
%%
6262

63-
void
63+
void __attribute__((noreturn))
6464
yyerror(const char *message)
6565
{
6666
if (*yytext == YY_END_OF_BUFFER_CHAR)

contrib/seg/segscan.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ float ({integer}|{real})([eE]{integer})?
5959

6060
%%
6161

62-
void
62+
void __attribute__((noreturn))
6363
yyerror(const char *message)
6464
{
6565
if (*yytext == YY_END_OF_BUFFER_CHAR)

src/backend/replication/repl_scanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ addlitchar(unsigned char ychar)
152152
appendStringInfoChar(&litbuf, ychar);
153153
}
154154

155-
void
155+
void __attribute__((noreturn))
156156
yyerror(const char *message)
157157
{
158158
ereport(ERROR,

src/include/mb/pg_wchar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ extern void check_encoding_conversion_args(int src_encoding,
516516
int expected_src_encoding,
517517
int expected_dest_encoding);
518518

519-
extern void report_invalid_encoding(int encoding, const char *mbstr, int len);
519+
extern void report_invalid_encoding(int encoding, const char *mbstr, int len) __attribute__((noreturn));
520520
extern void report_untranslatable_char(int src_encoding, int dest_encoding,
521-
const char *mbstr, int len);
521+
const char *mbstr, int len) __attribute__((noreturn));
522522

523523
extern void pg_ascii2mic(const unsigned char *l, unsigned char *p, int len);
524524
extern void pg_mic2ascii(const unsigned char *mic, unsigned char *p, int len);

src/include/parser/parse_relation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ extern bool isLockedRefname(ParseState *pstate, const char *refname);
8484
extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte,
8585
bool addToJoinList,
8686
bool addToRelNameSpace, bool addToVarNameSpace);
87-
extern void errorMissingRTE(ParseState *pstate, RangeVar *relation);
87+
extern void errorMissingRTE(ParseState *pstate, RangeVar *relation) __attribute__((noreturn));
8888
extern void errorMissingColumn(ParseState *pstate,
89-
char *relname, char *colname, int location);
89+
char *relname, char *colname, int location) __attribute__((noreturn));
9090
extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
9191
int location, bool include_dropped,
9292
List **colnames, List **colvars);

src/include/storage/lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ extern void lock_twophase_standby_recover(TransactionId xid, uint16 info,
533533

534534
extern DeadLockState DeadLockCheck(PGPROC *proc);
535535
extern PGPROC *GetBlockingAutoVacuumPgproc(void);
536-
extern void DeadLockReport(void);
536+
extern void DeadLockReport(void) __attribute__((noreturn));
537537
extern void RememberSimpleDeadLock(PGPROC *proc1,
538538
LOCKMODE lockmode,
539539
LOCK *lock,

src/include/tcop/tcopprot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern void assign_max_stack_depth(int newval, void *extra);
6464
extern void die(SIGNAL_ARGS);
6565
extern void quickdie(SIGNAL_ARGS) __attribute__((noreturn));
6666
extern void StatementCancelHandler(SIGNAL_ARGS);
67-
extern void FloatExceptionHandler(SIGNAL_ARGS);
67+
extern void FloatExceptionHandler(SIGNAL_ARGS) __attribute__((noreturn));
6868
extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
6969
* handler */
7070
extern void prepare_for_client_read(void);

src/pl/plpgsql/src/pl_scanner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ plpgsql_scanner_errposition(int location)
528528
* Beware of using yyerror for other purposes, as the cursor position might
529529
* be misleading!
530530
*/
531-
void
531+
void __attribute__((noreturn))
532532
plpgsql_yyerror(const char *message)
533533
{
534534
char *yytext = core_yy.scanbuf + plpgsql_yylloc;

0 commit comments

Comments
 (0)
0