]> granicus.if.org Git - postgresql/commitdiff
Add noreturn attributes to some error reporting functions
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 12 Feb 2013 12:13:22 +0000 (07:13 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 12 Feb 2013 12:13:22 +0000 (07:13 -0500)
contrib/cube/cubescan.l
contrib/seg/segscan.l
src/backend/replication/repl_scanner.l
src/include/mb/pg_wchar.h
src/include/parser/parse_relation.h
src/include/storage/lock.h
src/include/tcop/tcopprot.h
src/pl/plpgsql/src/pl_scanner.c

index a74eb4ba37e0b05d3f94413aac88e4b2827e294c..8f917cd33adc282ffba11c5d5f9d9703e6d025a0 100644 (file)
@@ -60,7 +60,7 @@ float        ({integer}|{real})([eE]{integer})?
 
 %%
 
-void
+void __attribute__((noreturn))
 yyerror(const char *message)
 {
        if (*yytext == YY_END_OF_BUFFER_CHAR)
index ce5ff31e47cca31ac5189bf105998c220184aab9..95139f4631800f5ced1cb21ef24f7839ccb2b840 100644 (file)
@@ -59,7 +59,7 @@ float        ({integer}|{real})([eE]{integer})?
 
 %%
 
-void
+void __attribute__((noreturn))
 yyerror(const char *message)
 {
        if (*yytext == YY_END_OF_BUFFER_CHAR)
index a1244983060e645d4ab0c464a67e6da7ca50c1b2..b4743e6357d0ed044eac28ebd12f9742fb80ca22 100644 (file)
@@ -152,7 +152,7 @@ addlitchar(unsigned char ychar)
        appendStringInfoChar(&litbuf, ychar);
 }
 
-void
+void __attribute__((noreturn))
 yyerror(const char *message)
 {
        ereport(ERROR,
index 907950dda4732a7cbfd25e0ec653c4e3688d8a06..78ddaf92e33407d8a2c42ae6afdf31c8671c5b09 100644 (file)
@@ -516,9 +516,9 @@ extern void check_encoding_conversion_args(int src_encoding,
                                                           int expected_src_encoding,
                                                           int expected_dest_encoding);
 
-extern void report_invalid_encoding(int encoding, const char *mbstr, int len);
+extern void report_invalid_encoding(int encoding, const char *mbstr, int len) __attribute__((noreturn));
 extern void report_untranslatable_char(int src_encoding, int dest_encoding,
-                                                  const char *mbstr, int len);
+                                                  const char *mbstr, int len) __attribute__((noreturn));
 
 extern void pg_ascii2mic(const unsigned char *l, unsigned char *p, int len);
 extern void pg_mic2ascii(const unsigned char *mic, unsigned char *p, int len);
index 561536f790a52949fe1aade54595c85d30d989b5..c9e4eafda93e54f909482df3cdd04d6c9b04ea8d 100644 (file)
@@ -84,9 +84,9 @@ extern bool isLockedRefname(ParseState *pstate, const char *refname);
 extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte,
                          bool addToJoinList,
                          bool addToRelNameSpace, bool addToVarNameSpace);
-extern void errorMissingRTE(ParseState *pstate, RangeVar *relation);
+extern void errorMissingRTE(ParseState *pstate, RangeVar *relation) __attribute__((noreturn));
 extern void errorMissingColumn(ParseState *pstate,
-                                  char *relname, char *colname, int location);
+                                  char *relname, char *colname, int location) __attribute__((noreturn));
 extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
                  int location, bool include_dropped,
                  List **colnames, List **colvars);
index f10c8f194fa0bff6822969a96651a31a43c21e0c..9642a19821e21cb10decd0dca700238661083998 100644 (file)
@@ -533,7 +533,7 @@ extern void lock_twophase_standby_recover(TransactionId xid, uint16 info,
 
 extern DeadLockState DeadLockCheck(PGPROC *proc);
 extern PGPROC *GetBlockingAutoVacuumPgproc(void);
-extern void DeadLockReport(void);
+extern void DeadLockReport(void) __attribute__((noreturn));
 extern void RememberSimpleDeadLock(PGPROC *proc1,
                                           LOCKMODE lockmode,
                                           LOCK *lock,
index 726fb74af236b2d373dabb759393423859a75243..e6f0afbedfebe4bd336bb31cabf7439f1a19ab69 100644 (file)
@@ -64,7 +64,7 @@ extern void assign_max_stack_depth(int newval, void *extra);
 extern void die(SIGNAL_ARGS);
 extern void quickdie(SIGNAL_ARGS) __attribute__((noreturn));
 extern void StatementCancelHandler(SIGNAL_ARGS);
-extern void FloatExceptionHandler(SIGNAL_ARGS);
+extern void FloatExceptionHandler(SIGNAL_ARGS) __attribute__((noreturn));
 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
                                                                                                                                 * handler */
 extern void prepare_for_client_read(void);
index 6dd63d738d162412150dbb10bbe58c0574efc621..ec448cbbc8b56533d46ab7ee9720da85392014c2 100644 (file)
@@ -528,7 +528,7 @@ plpgsql_scanner_errposition(int location)
  * Beware of using yyerror for other purposes, as the cursor position might
  * be misleading!
  */
-void
+void __attribute__((noreturn))
 plpgsql_yyerror(const char *message)
 {
        char       *yytext = core_yy.scanbuf + plpgsql_yylloc;