Commit 785941cd authored by Tom Lane's avatar Tom Lane

Tweak __attribute__-wrapping macros for better pgindent results.

This improves on commit bbfd7eda by
making two simple changes:

* pg_attribute_noreturn now takes parentheses, ie pg_attribute_noreturn().
Likewise pg_attribute_unused(), pg_attribute_packed().  This reduces
pgindent's tendency to misformat declarations involving them.

* attributes are now always attached to function declarations, not
definitions.  Previously some places were taking creative shortcuts,
which were not merely candidates for bad misformatting by pgindent
but often were outright wrong anyway.  (It does little good to put a
noreturn annotation where callers can't see it.)  In any case, if
we would like to believe that these macros can be used with non-gcc
compilers, we should avoid gratuitous variance in usage patterns.

I also went through and manually improved the formatting of a lot of
declarations, and got rid of excessively repetitive (and now obsolete
anyway) comments informing the reader what pg_attribute_printf is for.
parent d04c8ed9
...@@ -26,11 +26,6 @@ PG_MODULE_MAGIC; ...@@ -26,11 +26,6 @@ PG_MODULE_MAGIC;
#define ARRPTR(x) ( (double *) ARR_DATA_PTR(x) ) #define ARRPTR(x) ( (double *) ARR_DATA_PTR(x) )
#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x)) #define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))
extern int cube_yyparse(NDBOX **result);
extern void cube_yyerror(NDBOX **result, const char *message);
extern void cube_scanner_init(const char *str);
extern void cube_scanner_finish(void);
/* /*
** Input/Output routines ** Input/Output routines
*/ */
......
...@@ -46,3 +46,12 @@ typedef struct NDBOX ...@@ -46,3 +46,12 @@ typedef struct NDBOX
#define DatumGetNDBOX(x) ((NDBOX *) PG_DETOAST_DATUM(x)) #define DatumGetNDBOX(x) ((NDBOX *) PG_DETOAST_DATUM(x))
#define PG_GETARG_NDBOX(x) DatumGetNDBOX(PG_GETARG_DATUM(x)) #define PG_GETARG_NDBOX(x) DatumGetNDBOX(PG_GETARG_DATUM(x))
#define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x) #define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x)
/* in cubescan.l */
extern int cube_yylex(void);
extern void cube_yyerror(NDBOX **result, const char *message) pg_attribute_noreturn();
extern void cube_scanner_init(const char *str);
extern void cube_scanner_finish(void);
/* in cubeparse.y */
extern int cube_yyparse(NDBOX **result);
...@@ -22,14 +22,9 @@ ...@@ -22,14 +22,9 @@
#define YYMALLOC palloc #define YYMALLOC palloc
#define YYFREE pfree #define YYFREE pfree
extern int cube_yylex(void);
static char *scanbuf; static char *scanbuf;
static int scanbuflen; static int scanbuflen;
extern int cube_yyparse(NDBOX **result);
extern void cube_yyerror(NDBOX **result, const char *message);
static int delim_count(char *s, char delim); static int delim_count(char *s, char delim);
static NDBOX * write_box(unsigned int dim, char *str1, char *str2); static NDBOX * write_box(unsigned int dim, char *str1, char *str2);
static NDBOX * write_point_as_box(char *s, int dim); static NDBOX * write_point_as_box(char *s, int dim);
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* contrib/cube/cubescan.l * contrib/cube/cubescan.l
*/ */
#include "postgres.h"
/* No reason to constrain amount of data slurped */ /* No reason to constrain amount of data slurped */
#define YY_READ_BUF_SIZE 16777216 #define YY_READ_BUF_SIZE 16777216
...@@ -24,12 +22,6 @@ static YY_BUFFER_STATE scanbufhandle; ...@@ -24,12 +22,6 @@ static YY_BUFFER_STATE scanbufhandle;
/* this is now declared in cubeparse.y: */ /* this is now declared in cubeparse.y: */
/* static char *scanbuf; */ /* static char *scanbuf; */
/* static int scanbuflen; */ /* static int scanbuflen; */
/* flex 2.5.4 doesn't bother with a decl for this */
int cube_yylex(void);
void cube_scanner_init(const char *str);
void cube_scanner_finish(void);
%} %}
%option 8bit %option 8bit
...@@ -60,7 +52,7 @@ float ({integer}|{real})([eE]{integer})? ...@@ -60,7 +52,7 @@ float ({integer}|{real})([eE]{integer})?
%% %%
void pg_attribute_noreturn void
yyerror(NDBOX **result, const char *message) yyerror(NDBOX **result, const char *message)
{ {
if (*yytext == YY_END_OF_BUFFER_CHAR) if (*yytext == YY_END_OF_BUFFER_CHAR)
......
...@@ -356,10 +356,9 @@ void optionally_create_toast_tables(void); ...@@ -356,10 +356,9 @@ void optionally_create_toast_tables(void);
/* exec.c */ /* exec.c */
#define EXEC_PSQL_ARGS "--echo-queries --set ON_ERROR_STOP=on --no-psqlrc --dbname=template1" #define EXEC_PSQL_ARGS "--echo-queries --set ON_ERROR_STOP=on --no-psqlrc --dbname=template1"
bool
exec_prog(const char *log_file, const char *opt_log_file, bool exec_prog(const char *log_file, const char *opt_log_file,
bool throw_error, const char *fmt,...) bool throw_error, const char *fmt,...) pg_attribute_printf(4, 5);
pg_attribute_printf(4, 5);
void verify_directories(void); void verify_directories(void);
bool pid_lock_file_exists(const char *datadir); bool pid_lock_file_exists(const char *datadir);
...@@ -443,9 +442,7 @@ void init_tablespaces(void); ...@@ -443,9 +442,7 @@ void init_tablespaces(void);
/* server.c */ /* server.c */
PGconn *connectToServer(ClusterInfo *cluster, const char *db_name); PGconn *connectToServer(ClusterInfo *cluster, const char *db_name);
PGresult * PGresult *executeQueryOrDie(PGconn *conn, const char *fmt,...) pg_attribute_printf(2, 3);
executeQueryOrDie(PGconn *conn, const char *fmt,...)
pg_attribute_printf(2, 3);
char *cluster_conn_opts(ClusterInfo *cluster); char *cluster_conn_opts(ClusterInfo *cluster);
...@@ -460,19 +457,11 @@ void check_pghost_envvar(void); ...@@ -460,19 +457,11 @@ void check_pghost_envvar(void);
char *quote_identifier(const char *s); char *quote_identifier(const char *s);
int get_user_info(char **user_name_p); int get_user_info(char **user_name_p);
void check_ok(void); void check_ok(void);
void void report_status(eLogType type, const char *fmt,...) pg_attribute_printf(2, 3);
report_status(eLogType type, const char *fmt,...) void pg_log(eLogType type, const char *fmt,...) pg_attribute_printf(2, 3);
pg_attribute_printf(2, 3); void pg_fatal(const char *fmt,...) pg_attribute_printf(1, 2) pg_attribute_noreturn();
void
pg_log(eLogType type, const char *fmt,...)
pg_attribute_printf(2, 3);
void
pg_fatal(const char *fmt,...)
pg_attribute_printf(1, 2) pg_attribute_noreturn;
void end_progress_output(void); void end_progress_output(void);
void void prep_status(const char *fmt,...) pg_attribute_printf(1, 2);
prep_status(const char *fmt,...)
pg_attribute_printf(1, 2);
void check_ok(void); void check_ok(void);
const char *getErrorText(int errNum); const char *getErrorText(int errNum);
unsigned int str2uint(const char *str); unsigned int str2uint(const char *str);
...@@ -486,10 +475,8 @@ void new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, ...@@ -486,10 +475,8 @@ void new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster,
void old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster); void old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster);
/* parallel.c */ /* parallel.c */
void void parallel_exec_prog(const char *log_file, const char *opt_log_file,
parallel_exec_prog(const char *log_file, const char *opt_log_file, const char *fmt,...) pg_attribute_printf(3, 4);
const char *fmt,...)
pg_attribute_printf(3, 4);
void parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr, void parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
char *old_pgdata, char *new_pgdata, char *old_pgdata, char *new_pgdata,
char *old_tablespace); char *old_tablespace);
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
LogOpts log_opts; LogOpts log_opts;
static void pg_log_v(eLogType type, const char *fmt, va_list ap) pg_attribute_printf(2, 0);
/* /*
* report_status() * report_status()
* *
...@@ -81,9 +84,7 @@ prep_status(const char *fmt,...) ...@@ -81,9 +84,7 @@ prep_status(const char *fmt,...)
} }
static static void
pg_attribute_printf(2, 0)
void
pg_log_v(eLogType type, const char *fmt, va_list ap) pg_log_v(eLogType type, const char *fmt, va_list ap)
{ {
char message[QUERY_ALLOC]; char message[QUERY_ALLOC];
......
...@@ -67,9 +67,7 @@ typedef struct XLogDumpStats ...@@ -67,9 +67,7 @@ typedef struct XLogDumpStats
Stats record_stats[RM_NEXT_ID][MAX_XLINFO_TYPES]; Stats record_stats[RM_NEXT_ID][MAX_XLINFO_TYPES];
} XLogDumpStats; } XLogDumpStats;
static void static void fatal_error(const char *fmt,...) pg_attribute_printf(1, 2);
fatal_error(const char *fmt,...)
pg_attribute_printf(1, 2);
/* /*
* Big red button to push when things go horribly wrong. * Big red button to push when things go horribly wrong.
......
...@@ -206,9 +206,7 @@ void px_set_debug_handler(void (*handler) (const char *)); ...@@ -206,9 +206,7 @@ void px_set_debug_handler(void (*handler) (const char *));
void px_memset(void *ptr, int c, size_t len); void px_memset(void *ptr, int c, size_t len);
#ifdef PX_DEBUG #ifdef PX_DEBUG
void void px_debug(const char *fmt,...) pg_attribute_printf(1, 2);
px_debug(const char *fmt,...)
pg_attribute_printf(1, 2);
#else #else
#define px_debug(...) #define px_debug(...)
#endif #endif
......
...@@ -23,15 +23,6 @@ ...@@ -23,15 +23,6 @@
PG_MODULE_MAGIC; PG_MODULE_MAGIC;
extern int seg_yyparse(SEG *result);
extern void seg_yyerror(SEG *result, const char *message);
extern void seg_scanner_init(const char *str);
extern void seg_scanner_finish(void);
/*
extern int seg_yydebug;
*/
/* /*
* Auxiliary data structure for picksplit method. * Auxiliary data structure for picksplit method.
*/ */
...@@ -103,7 +94,6 @@ bool seg_different(SEG *a, SEG *b); ...@@ -103,7 +94,6 @@ bool seg_different(SEG *a, SEG *b);
** Auxiliary funxtions ** Auxiliary funxtions
*/ */
static int restore(char *s, float val, int n); static int restore(char *s, float val, int n);
int significant_digits(char *s);
/***************************************************************************** /*****************************************************************************
......
...@@ -10,3 +10,15 @@ typedef struct SEG ...@@ -10,3 +10,15 @@ typedef struct SEG
char l_ext; char l_ext;
char u_ext; char u_ext;
} SEG; } SEG;
/* in seg.c */
extern int significant_digits(char *str);
/* in segscan.l */
extern int seg_yylex(void);
extern void seg_yyerror(SEG *result, const char *message) pg_attribute_noreturn();
extern void seg_scanner_init(const char *str);
extern void seg_scanner_finish(void);
/* in segparse.y */
extern int seg_yyparse(SEG *result);
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "fmgr.h" #include "fmgr.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "segdata.h" #include "segdata.h"
/* /*
...@@ -20,13 +21,6 @@ ...@@ -20,13 +21,6 @@
#define YYMALLOC palloc #define YYMALLOC palloc
#define YYFREE pfree #define YYFREE pfree
extern int seg_yylex(void);
extern int significant_digits(char *str); /* defined in seg.c */
extern int seg_yyparse(SEG *result);
extern void seg_yyerror(SEG *result, const char *message);
static float seg_atof(char *value); static float seg_atof(char *value);
static char strbuf[25] = { static char strbuf[25] = {
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
* A scanner for EMP-style numeric ranges * A scanner for EMP-style numeric ranges
*/ */
#include "postgres.h"
/* No reason to constrain amount of data slurped */ /* No reason to constrain amount of data slurped */
#define YY_READ_BUF_SIZE 16777216 #define YY_READ_BUF_SIZE 16777216
...@@ -22,12 +20,6 @@ fprintf_to_ereport(const char *fmt, const char *msg) ...@@ -22,12 +20,6 @@ fprintf_to_ereport(const char *fmt, const char *msg)
static YY_BUFFER_STATE scanbufhandle; static YY_BUFFER_STATE scanbufhandle;
static char *scanbuf; static char *scanbuf;
static int scanbuflen; static int scanbuflen;
/* flex 2.5.4 doesn't bother with a decl for this */
int seg_yylex(void);
void seg_scanner_init(const char *str);
void seg_scanner_finish(void);
%} %}
%option 8bit %option 8bit
...@@ -59,7 +51,7 @@ float ({integer}|{real})([eE]{integer})? ...@@ -59,7 +51,7 @@ float ({integer}|{real})([eE]{integer})?
%% %%
void pg_attribute_noreturn void
yyerror(SEG *result, const char *message) yyerror(SEG *result, const char *message)
{ {
if (*yytext == YY_END_OF_BUFFER_CHAR) if (*yytext == YY_END_OF_BUFFER_CHAR)
......
...@@ -32,11 +32,7 @@ static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record, ...@@ -32,11 +32,7 @@ static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
XLogRecPtr recptr); XLogRecPtr recptr);
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
int reqLen); int reqLen);
static void static void report_invalid_record(XLogReaderState *state, const char *fmt,...) pg_attribute_printf(2, 3);
report_invalid_record(XLogReaderState *state, const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(2, 3);
static void ResetDecoder(XLogReaderState *state); static void ResetDecoder(XLogReaderState *state);
......
...@@ -281,8 +281,8 @@ int AutovacuumLauncherPid = 0; ...@@ -281,8 +281,8 @@ int AutovacuumLauncherPid = 0;
static pid_t avlauncher_forkexec(void); static pid_t avlauncher_forkexec(void);
static pid_t avworker_forkexec(void); static pid_t avworker_forkexec(void);
#endif #endif
NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn; NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn; NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn();
static Oid do_start_worker(void); static Oid do_start_worker(void);
static void launcher_determine_sleep(bool canlaunch, bool recursing, static void launcher_determine_sleep(bool canlaunch, bool recursing,
......
...@@ -86,7 +86,7 @@ static volatile sig_atomic_t ready_to_stop = false; ...@@ -86,7 +86,7 @@ static volatile sig_atomic_t ready_to_stop = false;
static pid_t pgarch_forkexec(void); static pid_t pgarch_forkexec(void);
#endif #endif
NON_EXEC_STATIC void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn; NON_EXEC_STATIC void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn();
static void pgarch_exit(SIGNAL_ARGS); static void pgarch_exit(SIGNAL_ARGS);
static void ArchSigHupHandler(SIGNAL_ARGS); static void ArchSigHupHandler(SIGNAL_ARGS);
static void ArchSigTermHandler(SIGNAL_ARGS); static void ArchSigTermHandler(SIGNAL_ARGS);
......
...@@ -251,7 +251,7 @@ static instr_time total_func_time; ...@@ -251,7 +251,7 @@ static instr_time total_func_time;
static pid_t pgstat_forkexec(void); static pid_t pgstat_forkexec(void);
#endif #endif
NON_EXEC_STATIC void PgstatCollectorMain(int argc, char *argv[]) pg_attribute_noreturn; NON_EXEC_STATIC void PgstatCollectorMain(int argc, char *argv[]) pg_attribute_noreturn();
static void pgstat_exit(SIGNAL_ARGS); static void pgstat_exit(SIGNAL_ARGS);
static void pgstat_beshutdown_hook(int code, Datum arg); static void pgstat_beshutdown_hook(int code, Datum arg);
static void pgstat_sighup_handler(SIGNAL_ARGS); static void pgstat_sighup_handler(SIGNAL_ARGS);
......
...@@ -380,8 +380,8 @@ static void LogChildExit(int lev, const char *procname, ...@@ -380,8 +380,8 @@ static void LogChildExit(int lev, const char *procname,
int pid, int exitstatus); int pid, int exitstatus);
static void PostmasterStateMachine(void); static void PostmasterStateMachine(void);
static void BackendInitialize(Port *port); static void BackendInitialize(Port *port);
static void BackendRun(Port *port) pg_attribute_noreturn; static void BackendRun(Port *port) pg_attribute_noreturn();
static void ExitPostmaster(int status) pg_attribute_noreturn; static void ExitPostmaster(int status) pg_attribute_noreturn();
static int ServerLoop(void); static int ServerLoop(void);
static int BackendStartup(Port *port); static int BackendStartup(Port *port);
static int ProcessStartupPacket(Port *port, bool SSLdone); static int ProcessStartupPacket(Port *port, bool SSLdone);
......
...@@ -130,7 +130,7 @@ static volatile sig_atomic_t rotation_requested = false; ...@@ -130,7 +130,7 @@ static volatile sig_atomic_t rotation_requested = false;
static pid_t syslogger_forkexec(void); static pid_t syslogger_forkexec(void);
static void syslogger_parseArgs(int argc, char *argv[]); static void syslogger_parseArgs(int argc, char *argv[]);
#endif #endif
NON_EXEC_STATIC void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn; NON_EXEC_STATIC void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn();
static void process_pipe_input(char *logbuffer, int *bytes_in_logbuffer); static void process_pipe_input(char *logbuffer, int *bytes_in_logbuffer);
static void flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer); static void flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer);
static void open_csvlogfile(void); static void open_csvlogfile(void);
......
...@@ -205,7 +205,7 @@ addlitchar(unsigned char ychar) ...@@ -205,7 +205,7 @@ addlitchar(unsigned char ychar)
appendStringInfoChar(&litbuf, ychar); appendStringInfoChar(&litbuf, ychar);
} }
void pg_attribute_noreturn void
yyerror(const char *message) yyerror(const char *message)
{ {
ereport(ERROR, ereport(ERROR,
......
...@@ -193,7 +193,7 @@ typedef void (*WalSndSendDataCallback) (void); ...@@ -193,7 +193,7 @@ typedef void (*WalSndSendDataCallback) (void);
static void WalSndLoop(WalSndSendDataCallback send_data); static void WalSndLoop(WalSndSendDataCallback send_data);
static void InitWalSenderSlot(void); static void InitWalSenderSlot(void);
static void WalSndKill(int code, Datum arg); static void WalSndKill(int code, Datum arg);
static void WalSndShutdown(void) pg_attribute_noreturn; static void WalSndShutdown(void) pg_attribute_noreturn();
static void XLogSendPhysical(void); static void XLogSendPhysical(void);
static void XLogSendLogical(void); static void XLogSendLogical(void);
static void WalSndDone(WalSndSendDataCallback send_data); static void WalSndDone(WalSndSendDataCallback send_data);
......
...@@ -82,11 +82,7 @@ ...@@ -82,11 +82,7 @@
#undef _ #undef _
#define _(x) err_gettext(x) #define _(x) err_gettext(x)
static const char * static const char *err_gettext(const char *str) pg_attribute_format_arg(1);
err_gettext(const char *str)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_format_arg(1);
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str); static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str);
/* Global variables */ /* Global variables */
......
...@@ -129,10 +129,7 @@ char *GUC_check_errmsg_string; ...@@ -129,10 +129,7 @@ char *GUC_check_errmsg_string;
char *GUC_check_errdetail_string; char *GUC_check_errdetail_string;
char *GUC_check_errhint_string; char *GUC_check_errhint_string;
static void static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4);
do_serialize(char **destptr, Size *maxbytes, const char *fmt,...)
/* This lets gcc check the format string for consistency. */
pg_attribute_printf(3, 4);
static void set_config_sourcefile(const char *name, char *sourcefile, static void set_config_sourcefile(const char *name, char *sourcefile,
int sourceline); int sourceline);
......
...@@ -116,11 +116,7 @@ static pid_t postmasterPID = -1; ...@@ -116,11 +116,7 @@ static pid_t postmasterPID = -1;
#endif #endif
static void static void write_stderr(const char *fmt,...) pg_attribute_printf(1, 2);
write_stderr(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
static void do_advice(void); static void do_advice(void);
static void do_help(void); static void do_help(void);
static void set_mode(char *modeopt); static void set_mode(char *modeopt);
......
...@@ -78,10 +78,8 @@ static ShutdownInformation shutdown_info; ...@@ -78,10 +78,8 @@ static ShutdownInformation shutdown_info;
static const char *modulename = gettext_noop("parallel archiver"); static const char *modulename = gettext_noop("parallel archiver");
static ParallelSlot *GetMyPSlot(ParallelState *pstate); static ParallelSlot *GetMyPSlot(ParallelState *pstate);
static void static void parallel_msg_master(ParallelSlot *slot, const char *modulename,
parallel_msg_master(ParallelSlot *slot, const char *modulename, const char *fmt, va_list ap) pg_attribute_printf(3, 0);
const char *fmt, va_list ap)
pg_attribute_printf(3, 0);
static void archive_close_connection(int code, void *arg); static void archive_close_connection(int code, void *arg);
static void ShutdownWorkersHard(ParallelState *pstate); static void ShutdownWorkersHard(ParallelState *pstate);
static void WaitForTerminatingWorkers(ParallelState *pstate); static void WaitForTerminatingWorkers(ParallelState *pstate);
......
...@@ -277,10 +277,7 @@ extern void SortTocFromFile(Archive *AHX, RestoreOptions *ropt); ...@@ -277,10 +277,7 @@ extern void SortTocFromFile(Archive *AHX, RestoreOptions *ropt);
/* Convenience functions used only when writing DATA */ /* Convenience functions used only when writing DATA */
extern void archputs(const char *s, Archive *AH); extern void archputs(const char *s, Archive *AH);
extern int extern int archprintf(Archive *AH, const char *fmt,...) pg_attribute_printf(2, 3);
archprintf(Archive *AH, const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(2, 3);
#define appendStringLiteralAH(buf,str,AH) \ #define appendStringLiteralAH(buf,str,AH) \
appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings) appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings)
......
...@@ -28,17 +28,11 @@ typedef void (*on_exit_nicely_callback) (int code, void *arg); ...@@ -28,17 +28,11 @@ typedef void (*on_exit_nicely_callback) (int code, void *arg);
extern const char *progname; extern const char *progname;
extern void set_dump_section(const char *arg, int *dumpSections); extern void set_dump_section(const char *arg, int *dumpSections);
extern void extern void write_msg(const char *modulename, const char *fmt,...) pg_attribute_printf(2, 3);
write_msg(const char *modulename, const char *fmt,...) extern void vwrite_msg(const char *modulename, const char *fmt, va_list ap) pg_attribute_printf(2, 0);
pg_attribute_printf(2, 3);
extern void
vwrite_msg(const char *modulename, const char *fmt, va_list ap)
pg_attribute_printf(2, 0);
extern void on_exit_nicely(on_exit_nicely_callback function, void *arg); extern void on_exit_nicely(on_exit_nicely_callback function, void *arg);
extern void exit_nicely(int code) pg_attribute_noreturn; extern void exit_nicely(int code) pg_attribute_noreturn();
extern void extern void exit_horribly(const char *modulename, const char *fmt,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
exit_horribly(const char *modulename, const char *fmt,...)
pg_attribute_printf(2, 3) pg_attribute_noreturn;
#endif /* PG_BACKUP_UTILS_H */ #endif /* PG_BACKUP_UTILS_H */
...@@ -27,10 +27,8 @@ typedef enum ...@@ -27,10 +27,8 @@ typedef enum
PG_FATAL PG_FATAL
} eLogType; } eLogType;
extern void pg_log(eLogType type, const char *fmt,...) extern void pg_log(eLogType type, const char *fmt,...) pg_attribute_printf(2, 3);
pg_attribute_printf(2, 3); extern void pg_fatal(const char *fmt,...) pg_attribute_printf(1, 2) pg_attribute_noreturn();
extern void pg_fatal(const char *fmt,...)
pg_attribute_printf(1, 2) pg_attribute_noreturn;
extern void progress_report(bool force); extern void progress_report(bool force);
......
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
extern bool setQFout(const char *fname); extern bool setQFout(const char *fname);
extern void extern void psql_error(const char *fmt,...) pg_attribute_printf(1, 2);
psql_error(const char *fmt,...)
/* This lets gcc check the format string for consistency. */
pg_attribute_printf(1, 2);
extern void NoticeProcessor(void *arg, const char *message); extern void NoticeProcessor(void *arg, const char *message);
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
#include "settings.h" #include "settings.h"
#include "common.h" #include "common.h"
static void static void print_lo_result(const char *fmt,...) pg_attribute_printf(1, 2);
print_lo_result(const char *fmt,...)
pg_attribute_printf(1, 2);
static void static void
print_lo_result(const char *fmt,...) print_lo_result(const char *fmt,...)
......
...@@ -32,7 +32,7 @@ extern Form_pg_attribute attrtypes[MAXATTR]; ...@@ -32,7 +32,7 @@ extern Form_pg_attribute attrtypes[MAXATTR];
extern int numattr; extern int numattr;
extern void AuxiliaryProcessMain(int argc, char *argv[]) pg_attribute_noreturn; extern void AuxiliaryProcessMain(int argc, char *argv[]) pg_attribute_noreturn();
extern void err_out(void); extern void err_out(void);
...@@ -61,6 +61,6 @@ extern void boot_get_type_io_data(Oid typid, ...@@ -61,6 +61,6 @@ extern void boot_get_type_io_data(Oid typid,
extern int boot_yyparse(void); extern int boot_yyparse(void);
extern int boot_yylex(void); extern int boot_yylex(void);
extern void boot_yyerror(const char *str) pg_attribute_noreturn; extern void boot_yyerror(const char *str) pg_attribute_noreturn();
#endif /* BOOTSTRAP_H */ #endif /* BOOTSTRAP_H */
...@@ -621,9 +621,9 @@ typedef NameData *Name; ...@@ -621,9 +621,9 @@ typedef NameData *Name;
/* only GCC supports the unused attribute */ /* only GCC supports the unused attribute */
#ifdef __GNUC__ #ifdef __GNUC__
#define pg_attribute_unused __attribute__((unused)) #define pg_attribute_unused() __attribute__((unused))
#else #else
#define pg_attribute_unused #define pg_attribute_unused()
#endif #endif
/* GCC and XLC support format attributes */ /* GCC and XLC support format attributes */
...@@ -638,15 +638,16 @@ typedef NameData *Name; ...@@ -638,15 +638,16 @@ typedef NameData *Name;
/* GCC, Sunpro and XLC support aligned, packed and noreturn */ /* GCC, Sunpro and XLC support aligned, packed and noreturn */
#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__) #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
#define pg_attribute_aligned(a) __attribute__((aligned(a))) #define pg_attribute_aligned(a) __attribute__((aligned(a)))
#define pg_attribute_noreturn __attribute__((noreturn)) #define pg_attribute_noreturn() __attribute__((noreturn))
#define pg_attribute_packed __attribute__((packed)) #define pg_attribute_packed() __attribute__((packed))
#define HAVE_PG_ATTRIBUTE_NORETURN 1
#else #else
/* /*
* NB: aligned and packed are not defined as empty as they affect code * NB: aligned and packed are not given default definitions because they
* functionality; they must be implemented by the compiler if they are to be * affect code functionality; they *must* be implemented by the compiler
* used. * if they are to be used.
*/ */
#define pg_attribute_noreturn #define pg_attribute_noreturn()
#endif #endif
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
...@@ -995,7 +996,7 @@ typedef NameData *Name; ...@@ -995,7 +996,7 @@ typedef NameData *Name;
#ifdef USE_ASSERT_CHECKING #ifdef USE_ASSERT_CHECKING
#define PG_USED_FOR_ASSERTS_ONLY #define PG_USED_FOR_ASSERTS_ONLY
#else #else
#define PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused #define PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused()
#endif #endif
...@@ -1059,10 +1060,7 @@ typedef NameData *Name; ...@@ -1059,10 +1060,7 @@ typedef NameData *Name;
*/ */
#if !HAVE_DECL_SNPRINTF #if !HAVE_DECL_SNPRINTF
extern int extern int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3, 4);
snprintf(char *str, size_t count, const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(3, 4);
#endif #endif
#if !HAVE_DECL_VSNPRINTF #if !HAVE_DECL_VSNPRINTF
......
...@@ -24,11 +24,7 @@ extern void *repalloc(void *pointer, Size size); ...@@ -24,11 +24,7 @@ extern void *repalloc(void *pointer, Size size);
extern void pfree(void *pointer); extern void pfree(void *pointer);
/* sprintf into a palloc'd buffer --- these are in psprintf.c */ /* sprintf into a palloc'd buffer --- these are in psprintf.c */
extern char * extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2);
psprintf(const char *fmt,...) extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
pg_attribute_printf(1, 2);
extern size_t
pvsnprintf(char *buf, size_t len, const char *fmt, va_list args)
pg_attribute_printf(3, 0);
#endif /* FE_MEMUTILS_H */ #endif /* FE_MEMUTILS_H */
...@@ -92,10 +92,7 @@ extern void resetStringInfo(StringInfo str); ...@@ -92,10 +92,7 @@ extern void resetStringInfo(StringInfo str);
* to str if necessary. This is sort of like a combination of sprintf and * to str if necessary. This is sort of like a combination of sprintf and
* strcat. * strcat.
*/ */
extern void extern void appendStringInfo(StringInfo str, const char *fmt,...) pg_attribute_printf(2, 3);
appendStringInfo(StringInfo str, const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(2, 3);
/*------------------------ /*------------------------
* appendStringInfoVA * appendStringInfoVA
...@@ -106,9 +103,7 @@ pg_attribute_printf(2, 3); ...@@ -106,9 +103,7 @@ pg_attribute_printf(2, 3);
* pass the return value to enlargeStringInfo() before trying again; see * pass the return value to enlargeStringInfo() before trying again; see
* appendStringInfo for standard usage pattern. * appendStringInfo for standard usage pattern.
*/ */
extern int extern int appendStringInfoVA(StringInfo str, const char *fmt, va_list args) pg_attribute_printf(2, 0);
appendStringInfoVA(StringInfo str, const char *fmt, va_list args)
pg_attribute_printf(2, 0);
/*------------------------ /*------------------------
* appendStringInfoString * appendStringInfoString
......
...@@ -514,9 +514,9 @@ extern void check_encoding_conversion_args(int src_encoding, ...@@ -514,9 +514,9 @@ extern void check_encoding_conversion_args(int src_encoding,
int expected_src_encoding, int expected_src_encoding,
int expected_dest_encoding); int expected_dest_encoding);
extern void report_invalid_encoding(int encoding, const char *mbstr, int len) pg_attribute_noreturn; extern void report_invalid_encoding(int encoding, const char *mbstr, int len) pg_attribute_noreturn();
extern void report_untranslatable_char(int src_encoding, int dest_encoding, extern void report_untranslatable_char(int src_encoding, int dest_encoding,
const char *mbstr, int len) pg_attribute_noreturn; const char *mbstr, int len) pg_attribute_noreturn();
extern void pg_ascii2mic(const unsigned char *l, unsigned char *p, int len); 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); extern void pg_mic2ascii(const unsigned char *mic, unsigned char *p, int len);
......
...@@ -104,9 +104,9 @@ extern bool isLockedRefname(ParseState *pstate, const char *refname); ...@@ -104,9 +104,9 @@ extern bool isLockedRefname(ParseState *pstate, const char *refname);
extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte, extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte,
bool addToJoinList, bool addToJoinList,
bool addToRelNameSpace, bool addToVarNameSpace); bool addToRelNameSpace, bool addToVarNameSpace);
extern void errorMissingRTE(ParseState *pstate, RangeVar *relation) pg_attribute_noreturn; extern void errorMissingRTE(ParseState *pstate, RangeVar *relation) pg_attribute_noreturn();
extern void errorMissingColumn(ParseState *pstate, extern void errorMissingColumn(ParseState *pstate,
char *relname, char *colname, int location) pg_attribute_noreturn; char *relname, char *colname, int location) pg_attribute_noreturn();
extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
int location, bool include_dropped, int location, bool include_dropped,
List **colnames, List **colvars); List **colnames, List **colvars);
......
...@@ -125,6 +125,6 @@ extern void scanner_finish(core_yyscan_t yyscanner); ...@@ -125,6 +125,6 @@ extern void scanner_finish(core_yyscan_t yyscanner);
extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp, extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp,
core_yyscan_t yyscanner); core_yyscan_t yyscanner);
extern int scanner_errposition(int location, core_yyscan_t yyscanner); extern int scanner_errposition(int location, core_yyscan_t yyscanner);
extern void scanner_yyerror(const char *message, core_yyscan_t yyscanner) pg_attribute_noreturn; extern void scanner_yyerror(const char *message, core_yyscan_t yyscanner) pg_attribute_noreturn();
#endif /* SCANNER_H */ #endif /* SCANNER_H */
...@@ -875,7 +875,7 @@ extern void pgstat_reset_all(void); ...@@ -875,7 +875,7 @@ extern void pgstat_reset_all(void);
extern void allow_immediate_pgstat_restart(void); extern void allow_immediate_pgstat_restart(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void PgstatCollectorMain(int argc, char *argv[]) pg_attribute_noreturn; extern void PgstatCollectorMain(int argc, char *argv[]) pg_attribute_noreturn();
#endif #endif
......
...@@ -153,23 +153,11 @@ extern unsigned char pg_ascii_tolower(unsigned char ch); ...@@ -153,23 +153,11 @@ extern unsigned char pg_ascii_tolower(unsigned char ch);
#endif #endif
extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args); extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
extern int extern int pg_snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3, 4);
pg_snprintf(char *str, size_t count, const char *fmt,...) extern int pg_sprintf(char *str, const char *fmt,...) pg_attribute_printf(2, 3);
/* This extension allows gcc to check the format string */
pg_attribute_printf(3, 4);
extern int
pg_sprintf(char *str, const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(2, 3);
extern int pg_vfprintf(FILE *stream, const char *fmt, va_list args); extern int pg_vfprintf(FILE *stream, const char *fmt, va_list args);
extern int extern int pg_fprintf(FILE *stream, const char *fmt,...) pg_attribute_printf(2, 3);
pg_fprintf(FILE *stream, const char *fmt,...) extern int pg_printf(const char *fmt,...) pg_attribute_printf(1, 2);
/* This extension allows gcc to check the format string */
pg_attribute_printf(2, 3);
extern int
pg_printf(const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(1, 2);
/* /*
* The GCC-specific code below prevents the pg_attribute_printf above from * The GCC-specific code below prevents the pg_attribute_printf above from
......
...@@ -687,6 +687,6 @@ extern Datum Float8GetDatum(float8 X); ...@@ -687,6 +687,6 @@ extern Datum Float8GetDatum(float8 X);
*/ */
extern void ExceptionalCondition(const char *conditionName, extern void ExceptionalCondition(const char *conditionName,
const char *errorType, const char *errorType,
const char *fileName, int lineNumber) pg_attribute_noreturn; const char *fileName, int lineNumber) pg_attribute_noreturn();
#endif /* POSTGRES_H */ #endif /* POSTGRES_H */
...@@ -54,8 +54,8 @@ extern void AutoVacWorkerFailed(void); ...@@ -54,8 +54,8 @@ extern void AutoVacWorkerFailed(void);
extern void AutoVacuumUpdateDelay(void); extern void AutoVacuumUpdateDelay(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn; extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn();
extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn; extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
extern void AutovacuumWorkerIAm(void); extern void AutovacuumWorkerIAm(void);
extern void AutovacuumLauncherIAm(void); extern void AutovacuumLauncherIAm(void);
#endif #endif
......
...@@ -46,7 +46,7 @@ extern void BackgroundWorkerStopNotifications(pid_t pid); ...@@ -46,7 +46,7 @@ extern void BackgroundWorkerStopNotifications(pid_t pid);
extern void ResetBackgroundWorkerCrashTimes(void); extern void ResetBackgroundWorkerCrashTimes(void);
/* Function to start a background worker, called from postmaster.c */ /* Function to start a background worker, called from postmaster.c */
extern void StartBackgroundWorker(void) pg_attribute_noreturn; extern void StartBackgroundWorker(void) pg_attribute_noreturn();
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern BackgroundWorker *BackgroundWorkerEntry(int slotno); extern BackgroundWorker *BackgroundWorkerEntry(int slotno);
......
...@@ -25,8 +25,8 @@ extern int CheckPointTimeout; ...@@ -25,8 +25,8 @@ extern int CheckPointTimeout;
extern int CheckPointWarning; extern int CheckPointWarning;
extern double CheckPointCompletionTarget; extern double CheckPointCompletionTarget;
extern void BackgroundWriterMain(void) pg_attribute_noreturn; extern void BackgroundWriterMain(void) pg_attribute_noreturn();
extern void CheckpointerMain(void) pg_attribute_noreturn; extern void CheckpointerMain(void) pg_attribute_noreturn();
extern void RequestCheckpoint(int flags); extern void RequestCheckpoint(int flags);
extern void CheckpointWriteDelay(int flags, double progress); extern void CheckpointWriteDelay(int flags, double progress);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
extern int pgarch_start(void); extern int pgarch_start(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn; extern void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn();
#endif #endif
#endif /* _PGARCH_H */ #endif /* _PGARCH_H */
...@@ -46,7 +46,7 @@ extern int postmaster_alive_fds[2]; ...@@ -46,7 +46,7 @@ extern int postmaster_alive_fds[2];
extern const char *progname; extern const char *progname;
extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn; extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
extern void ClosePostmasterPorts(bool am_syslogger); extern void ClosePostmasterPorts(bool am_syslogger);
extern int MaxLivePostmasterChildren(void); extern int MaxLivePostmasterChildren(void);
...@@ -56,7 +56,7 @@ extern bool PostmasterMarkPIDForWorkerNotify(int); ...@@ -56,7 +56,7 @@ extern bool PostmasterMarkPIDForWorkerNotify(int);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern pid_t postmaster_forkexec(int argc, char *argv[]); extern pid_t postmaster_forkexec(int argc, char *argv[]);
extern void SubPostmasterMain(int argc, char *argv[]) pg_attribute_noreturn; extern void SubPostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
extern Size ShmemBackendArraySize(void); extern Size ShmemBackendArraySize(void);
extern void ShmemBackendArrayAllocation(void); extern void ShmemBackendArrayAllocation(void);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define _STARTUP_H #define _STARTUP_H
extern void HandleStartupProcInterrupts(void); extern void HandleStartupProcInterrupts(void);
extern void StartupProcessMain(void) pg_attribute_noreturn; extern void StartupProcessMain(void) pg_attribute_noreturn();
extern void PreRestoreCommand(void); extern void PreRestoreCommand(void);
extern void PostRestoreCommand(void); extern void PostRestoreCommand(void);
extern bool IsPromoteTriggered(void); extern bool IsPromoteTriggered(void);
......
...@@ -84,7 +84,7 @@ extern int SysLogger_Start(void); ...@@ -84,7 +84,7 @@ extern int SysLogger_Start(void);
extern void write_syslogger_file(const char *buffer, int count, int dest); extern void write_syslogger_file(const char *buffer, int count, int dest);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn; extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn();
#endif #endif
#endif /* _SYSLOGGER_H */ #endif /* _SYSLOGGER_H */
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
/* GUC options */ /* GUC options */
extern int WalWriterDelay; extern int WalWriterDelay;
extern void WalWriterMain(void) pg_attribute_noreturn; extern void WalWriterMain(void) pg_attribute_noreturn();
#endif /* _WALWRITER_H */ #endif /* _WALWRITER_H */
...@@ -147,7 +147,7 @@ typedef void (*walrcv_disconnect_type) (void); ...@@ -147,7 +147,7 @@ typedef void (*walrcv_disconnect_type) (void);
extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect; extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect;
/* prototypes for functions in walreceiver.c */ /* prototypes for functions in walreceiver.c */
extern void WalReceiverMain(void) pg_attribute_noreturn; extern void WalReceiverMain(void) pg_attribute_noreturn();
/* prototypes for functions in walreceiverfuncs.c */ /* prototypes for functions in walreceiverfuncs.c */
extern Size WalRcvShmemSize(void); extern Size WalRcvShmemSize(void);
......
...@@ -102,7 +102,7 @@ extern void WalSndSetState(WalSndState state); ...@@ -102,7 +102,7 @@ extern void WalSndSetState(WalSndState state);
*/ */
extern int replication_yyparse(void); extern int replication_yyparse(void);
extern int replication_yylex(void); extern int replication_yylex(void);
extern void replication_yyerror(const char *str); extern void replication_yyerror(const char *str) pg_attribute_noreturn();
extern void replication_scanner_init(const char *query_string); extern void replication_scanner_init(const char *query_string);
extern void replication_scanner_finish(void); extern void replication_scanner_finish(void);
......
...@@ -64,7 +64,7 @@ typedef void (*shmem_startup_hook_type) (void); ...@@ -64,7 +64,7 @@ typedef void (*shmem_startup_hook_type) (void);
/* ipc.c */ /* ipc.c */
extern PGDLLIMPORT bool proc_exit_inprogress; extern PGDLLIMPORT bool proc_exit_inprogress;
extern void proc_exit(int code) pg_attribute_noreturn; extern void proc_exit(int code) pg_attribute_noreturn();
extern void shmem_exit(int code); extern void shmem_exit(int code);
extern void on_proc_exit(pg_on_exit_callback function, Datum arg); extern void on_proc_exit(pg_on_exit_callback function, Datum arg);
extern void on_shmem_exit(pg_on_exit_callback function, Datum arg); extern void on_shmem_exit(pg_on_exit_callback function, Datum arg);
......
...@@ -41,7 +41,7 @@ typedef struct ItemPointerData ...@@ -41,7 +41,7 @@ typedef struct ItemPointerData
} }
#ifdef __arm__ #ifdef __arm__
pg_attribute_packed /* Appropriate whack upside the head for ARM */ pg_attribute_packed() /* Appropriate whack upside the head for ARM */
#endif #endif
ItemPointerData; ItemPointerData;
......
...@@ -547,7 +547,7 @@ extern void lock_twophase_standby_recover(TransactionId xid, uint16 info, ...@@ -547,7 +547,7 @@ extern void lock_twophase_standby_recover(TransactionId xid, uint16 info,
extern DeadLockState DeadLockCheck(PGPROC *proc); extern DeadLockState DeadLockCheck(PGPROC *proc);
extern PGPROC *GetBlockingAutoVacuumPgproc(void); extern PGPROC *GetBlockingAutoVacuumPgproc(void);
extern void DeadLockReport(void) pg_attribute_noreturn; extern void DeadLockReport(void) pg_attribute_noreturn();
extern void RememberSimpleDeadLock(PGPROC *proc1, extern void RememberSimpleDeadLock(PGPROC *proc1,
LOCKMODE lockmode, LOCKMODE lockmode,
LOCK *lock, LOCK *lock,
......
...@@ -62,9 +62,9 @@ extern bool check_max_stack_depth(int *newval, void **extra, GucSource source); ...@@ -62,9 +62,9 @@ extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
extern void assign_max_stack_depth(int newval, void *extra); extern void assign_max_stack_depth(int newval, void *extra);
extern void die(SIGNAL_ARGS); extern void die(SIGNAL_ARGS);
extern void quickdie(SIGNAL_ARGS) pg_attribute_noreturn; extern void quickdie(SIGNAL_ARGS) pg_attribute_noreturn();
extern void StatementCancelHandler(SIGNAL_ARGS); extern void StatementCancelHandler(SIGNAL_ARGS);
extern void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn; extern void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn();
extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
* handler */ * handler */
extern void ProcessClientReadInterrupt(bool blocked); extern void ProcessClientReadInterrupt(bool blocked);
...@@ -74,7 +74,7 @@ extern void process_postgres_switches(int argc, char *argv[], ...@@ -74,7 +74,7 @@ extern void process_postgres_switches(int argc, char *argv[],
GucContext ctx, const char **dbname); GucContext ctx, const char **dbname);
extern void PostgresMain(int argc, char *argv[], extern void PostgresMain(int argc, char *argv[],
const char *dbname, const char *dbname,
const char *username) pg_attribute_noreturn; const char *username) pg_attribute_noreturn();
extern long get_stack_depth_rlimit(void); extern long get_stack_depth_rlimit(void);
extern void ResetUsage(void); extern void ResetUsage(void);
extern void ShowUsage(const char *title); extern void ShowUsage(const char *title);
......
...@@ -315,7 +315,7 @@ extern int DecodeISO8601Interval(char *str, ...@@ -315,7 +315,7 @@ extern int DecodeISO8601Interval(char *str,
int *dtype, struct pg_tm * tm, fsec_t *fsec); int *dtype, struct pg_tm * tm, fsec_t *fsec);
extern void DateTimeParseError(int dterr, const char *str, extern void DateTimeParseError(int dterr, const char *str,
const char *datatype) pg_attribute_noreturn; const char *datatype) pg_attribute_noreturn();
extern int DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp); extern int DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp);
extern int DetermineTimeZoneAbbrevOffset(struct pg_tm * tm, const char *abbr, pg_tz *tzp); extern int DetermineTimeZoneAbbrevOffset(struct pg_tm * tm, const char *abbr, pg_tz *tzp);
......
...@@ -143,65 +143,25 @@ extern int errcode(int sqlerrcode); ...@@ -143,65 +143,25 @@ extern int errcode(int sqlerrcode);
extern int errcode_for_file_access(void); extern int errcode_for_file_access(void);
extern int errcode_for_socket_access(void); extern int errcode_for_socket_access(void);
extern int extern int errmsg(const char *fmt,...) pg_attribute_printf(1, 2);
errmsg(const char *fmt,...) extern int errmsg_internal(const char *fmt,...) pg_attribute_printf(1, 2);
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */ extern int errmsg_plural(const char *fmt_singular, const char *fmt_plural,
pg_attribute_printf(1, 2); unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
extern int extern int errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
errmsg_internal(const char *fmt,...) extern int errdetail_internal(const char *fmt,...) pg_attribute_printf(1, 2);
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */ extern int errdetail_log(const char *fmt,...) pg_attribute_printf(1, 2);
pg_attribute_printf(1, 2);
extern int errdetail_log_plural(const char *fmt_singular,
extern int const char *fmt_plural,
errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
unsigned long n,...)
/* This extension allows gcc to check the format string for consistency with extern int errdetail_plural(const char *fmt_singular, const char *fmt_plural,
the supplied arguments. */ unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
pg_attribute_printf(1, 4)
pg_attribute_printf(2, 4); extern int errhint(const char *fmt,...) pg_attribute_printf(1, 2);
extern int
errdetail(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
extern int
errdetail_internal(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
extern int
errdetail_log(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
extern int
errdetail_log_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 4)
pg_attribute_printf(2, 4);
extern int
errdetail_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 4)
pg_attribute_printf(2, 4);
extern int
errhint(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
/* /*
* errcontext() is typically called in error context callback functions, not * errcontext() is typically called in error context callback functions, not
...@@ -214,11 +174,8 @@ pg_attribute_printf(1, 2); ...@@ -214,11 +174,8 @@ pg_attribute_printf(1, 2);
#define errcontext set_errcontext_domain(TEXTDOMAIN), errcontext_msg #define errcontext set_errcontext_domain(TEXTDOMAIN), errcontext_msg
extern int set_errcontext_domain(const char *domain); extern int set_errcontext_domain(const char *domain);
extern int
errcontext_msg(const char *fmt,...) extern int errcontext_msg(const char *fmt,...) pg_attribute_printf(1, 2);
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
extern int errhidestmt(bool hide_stmt); extern int errhidestmt(bool hide_stmt);
extern int errhidecontext(bool hide_ctx); extern int errhidecontext(bool hide_ctx);
...@@ -274,21 +231,13 @@ extern int getinternalerrposition(void); ...@@ -274,21 +231,13 @@ extern int getinternalerrposition(void);
#endif /* HAVE__VA_ARGS */ #endif /* HAVE__VA_ARGS */
extern void elog_start(const char *filename, int lineno, const char *funcname); extern void elog_start(const char *filename, int lineno, const char *funcname);
extern void extern void elog_finish(int elevel, const char *fmt,...) pg_attribute_printf(2, 3);
elog_finish(int elevel, const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(2, 3);
/* Support for constructing error strings separately from ereport() calls */ /* Support for constructing error strings separately from ereport() calls */
extern void pre_format_elog_string(int errnumber, const char *domain); extern void pre_format_elog_string(int errnumber, const char *domain);
extern char * extern char *format_elog_string(const char *fmt,...) pg_attribute_printf(1, 2);
format_elog_string(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
/* Support for attaching context information to error reports */ /* Support for attaching context information to error reports */
...@@ -364,10 +313,10 @@ extern PGDLLIMPORT ErrorContextCallback *error_context_stack; ...@@ -364,10 +313,10 @@ extern PGDLLIMPORT ErrorContextCallback *error_context_stack;
} while (0) } while (0)
/* /*
* gcc understands pg_attribute_noreturn; for other compilers, insert * Some compilers understand pg_attribute_noreturn(); for other compilers,
* pg_unreachable() so that the compiler gets the point. * insert pg_unreachable() so that the compiler gets the point.
*/ */
#ifdef __GNUC__ #ifdef HAVE_PG_ATTRIBUTE_NORETURN
#define PG_RE_THROW() \ #define PG_RE_THROW() \
pg_re_throw() pg_re_throw()
#else #else
...@@ -423,9 +372,9 @@ extern void EmitErrorReport(void); ...@@ -423,9 +372,9 @@ extern void EmitErrorReport(void);
extern ErrorData *CopyErrorData(void); extern ErrorData *CopyErrorData(void);
extern void FreeErrorData(ErrorData *edata); extern void FreeErrorData(ErrorData *edata);
extern void FlushErrorState(void); extern void FlushErrorState(void);
extern void ReThrowError(ErrorData *edata) pg_attribute_noreturn; extern void ReThrowError(ErrorData *edata) pg_attribute_noreturn();
extern void ThrowErrorData(ErrorData *edata); extern void ThrowErrorData(ErrorData *edata);
extern void pg_re_throw(void) pg_attribute_noreturn; extern void pg_re_throw(void) pg_attribute_noreturn();
extern char *GetErrorContextStack(void); extern char *GetErrorContextStack(void);
...@@ -468,10 +417,6 @@ extern void set_syslog_parameters(const char *ident, int facility); ...@@ -468,10 +417,6 @@ extern void set_syslog_parameters(const char *ident, int facility);
* not available). Used before ereport/elog can be used * not available). Used before ereport/elog can be used
* safely (memory context, GUC load etc) * safely (memory context, GUC load etc)
*/ */
extern void extern void write_stderr(const char *fmt,...) pg_attribute_printf(1, 2);
write_stderr(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
#endif /* ELOG_H */ #endif /* ELOG_H */
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
#ifndef HELP_CONFIG_H #ifndef HELP_CONFIG_H
#define HELP_CONFIG_H 1 #define HELP_CONFIG_H 1
extern void GucInfoMain(void) pg_attribute_noreturn; extern void GucInfoMain(void) pg_attribute_noreturn();
#endif #endif
...@@ -136,11 +136,7 @@ extern char *pstrdup(const char *in); ...@@ -136,11 +136,7 @@ extern char *pstrdup(const char *in);
extern char *pnstrdup(const char *in, Size len); extern char *pnstrdup(const char *in, Size len);
/* sprintf into a palloc'd buffer --- these are in psprintf.c */ /* sprintf into a palloc'd buffer --- these are in psprintf.c */
extern char * extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2);
psprintf(const char *fmt,...) extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
pg_attribute_printf(1, 2);
extern size_t
pvsnprintf(char *buf, size_t len, const char *fmt, va_list args)
pg_attribute_printf(3, 0);
#endif /* PALLOC_H */ #endif /* PALLOC_H */
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
#include <string.h> #include <string.h>
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
extern char * extern char *ecpg_gettext(const char *msgid) pg_attribute_format_arg(1);
ecpg_gettext(const char *msgid)
pg_attribute_format_arg(1);
#else #else
#define ecpg_gettext(x) (x) #define ecpg_gettext(x) (x)
#endif #endif
......
...@@ -61,10 +61,12 @@ struct variable no_indicator = {"no_indicator", &ecpg_no_indicator, 0, NULL}; ...@@ -61,10 +61,12 @@ struct variable no_indicator = {"no_indicator", &ecpg_no_indicator, 0, NULL};
static struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, NULL, {NULL}, 0}; static struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, NULL, {NULL}, 0};
static void vmmerror(int error_code, enum errortype type, const char *error, va_list ap) pg_attribute_printf(3, 0);
/* /*
* Handle parsing errors and warnings * Handle parsing errors and warnings
*/ */
static void pg_attribute_printf(3, 0) static void
vmmerror(int error_code, enum errortype type, const char *error, va_list ap) vmmerror(int error_code, enum errortype type, const char *error, va_list ap)
{ {
/* localize the error message string */ /* localize the error message string */
......
...@@ -78,7 +78,7 @@ extern void base_yyerror(const char *); ...@@ -78,7 +78,7 @@ extern void base_yyerror(const char *);
extern void *mm_alloc(size_t), *mm_realloc(void *, size_t); extern void *mm_alloc(size_t), *mm_realloc(void *, size_t);
extern char *mm_strdup(const char *); extern char *mm_strdup(const char *);
extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4); extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn; extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
extern void output_get_descr_header(char *); extern void output_get_descr_header(char *);
extern void output_get_descr(char *, char *); extern void output_get_descr(char *, char *);
extern void output_set_descr_header(char *); extern void output_set_descr_header(char *);
......
...@@ -545,10 +545,7 @@ extern char *pqResultStrdup(PGresult *res, const char *str); ...@@ -545,10 +545,7 @@ extern char *pqResultStrdup(PGresult *res, const char *str);
extern void pqClearAsyncResult(PGconn *conn); extern void pqClearAsyncResult(PGconn *conn);
extern void pqSaveErrorResult(PGconn *conn); extern void pqSaveErrorResult(PGconn *conn);
extern PGresult *pqPrepareAsyncResult(PGconn *conn); extern PGresult *pqPrepareAsyncResult(PGconn *conn);
extern void extern void pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) pg_attribute_printf(2, 3);
pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...)
/* This lets gcc check the format string for consistency. */
pg_attribute_printf(2, 3);
extern void pqSaveMessageField(PGresult *res, char code, extern void pqSaveMessageField(PGresult *res, char code,
const char *value); const char *value);
extern void pqSaveParameterStatus(PGconn *conn, const char *name, extern void pqSaveParameterStatus(PGconn *conn, const char *name,
...@@ -651,12 +648,8 @@ extern ssize_t pgtls_write(PGconn *conn, const void *ptr, size_t len); ...@@ -651,12 +648,8 @@ extern ssize_t pgtls_write(PGconn *conn, const void *ptr, size_t len);
#define pqIsnonblocking(conn) ((conn)->nonblocking) #define pqIsnonblocking(conn) ((conn)->nonblocking)
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
extern char * extern char *libpq_gettext(const char *msgid) pg_attribute_format_arg(1);
libpq_gettext(const char *msgid) extern char *libpq_ngettext(const char *msgid, const char *msgid_plural, unsigned long n) pg_attribute_format_arg(1) pg_attribute_format_arg(2);
pg_attribute_format_arg(1);
extern char *
libpq_ngettext(const char *msgid, const char *msgid_plural, unsigned long n)
pg_attribute_format_arg(1) pg_attribute_format_arg(2);
#else #else
#define libpq_gettext(x) (x) #define libpq_gettext(x) (x)
#define libpq_ngettext(s, p, n) ((n) == 1 ? (s) : (p)) #define libpq_ngettext(s, p, n) ((n) == 1 ? (s) : (p))
......
...@@ -37,9 +37,7 @@ ...@@ -37,9 +37,7 @@
/* All "broken" PQExpBuffers point to this string. */ /* All "broken" PQExpBuffers point to this string. */
static const char oom_buffer[1] = ""; static const char oom_buffer[1] = "";
static bool static bool appendPQExpBufferVA(PQExpBuffer str, const char *fmt, va_list args) pg_attribute_printf(2, 0);
appendPQExpBufferVA(PQExpBuffer str, const char *fmt, va_list args)
pg_attribute_printf(2, 0);
/* /*
......
...@@ -146,10 +146,7 @@ extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed); ...@@ -146,10 +146,7 @@ extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed);
* This is a convenience routine that does the same thing as * This is a convenience routine that does the same thing as
* resetPQExpBuffer() followed by appendPQExpBuffer(). * resetPQExpBuffer() followed by appendPQExpBuffer().
*/ */
extern void extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2, 3);
printfPQExpBuffer(PQExpBuffer str, const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(2, 3);
/*------------------------ /*------------------------
* appendPQExpBuffer * appendPQExpBuffer
...@@ -158,10 +155,7 @@ pg_attribute_printf(2, 3); ...@@ -158,10 +155,7 @@ pg_attribute_printf(2, 3);
* to str if necessary. This is sort of like a combination of sprintf and * to str if necessary. This is sort of like a combination of sprintf and
* strcat. * strcat.
*/ */
extern void extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2, 3);
appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
/* This extension allows gcc to check the format string */
pg_attribute_printf(2, 3);
/*------------------------ /*------------------------
* appendPQExpBufferStr * appendPQExpBufferStr
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
/* Declared here to avoid pulling in all includes, which causes name collissions */ /* Declared here to avoid pulling in all includes, which causes name collissions */
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
extern char * extern char *libpq_gettext(const char *msgid) pg_attribute_format_arg(1);
libpq_gettext(const char *msgid)
pg_attribute_format_arg(1);
#else #else
#define libpq_gettext(x) (x) #define libpq_gettext(x) (x)
#endif #endif
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* Supply a value of PERL_UNUSED_DECL that will satisfy gcc - the one * Supply a value of PERL_UNUSED_DECL that will satisfy gcc - the one
* perl itself supplies doesn't seem to. * perl itself supplies doesn't seem to.
*/ */
#define PERL_UNUSED_DECL pg_attribute_unused #define PERL_UNUSED_DECL pg_attribute_unused()
/* /*
* Sometimes perl carefully scribbles on our *printf macros. * Sometimes perl carefully scribbles on our *printf macros.
......
...@@ -608,7 +608,7 @@ plpgsql_scanner_errposition(int location) ...@@ -608,7 +608,7 @@ plpgsql_scanner_errposition(int location)
* Beware of using yyerror for other purposes, as the cursor position might * Beware of using yyerror for other purposes, as the cursor position might
* be misleading! * be misleading!
*/ */
void pg_attribute_noreturn void
plpgsql_yyerror(const char *message) plpgsql_yyerror(const char *message)
{ {
char *yytext = core_yy.scanbuf + plpgsql_yylloc; char *yytext = core_yy.scanbuf + plpgsql_yylloc;
......
...@@ -1023,7 +1023,7 @@ extern int plpgsql_peek(void); ...@@ -1023,7 +1023,7 @@ extern int plpgsql_peek(void);
extern void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc, extern void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc,
int *tok2_loc); int *tok2_loc);
extern int plpgsql_scanner_errposition(int location); extern int plpgsql_scanner_errposition(int location);
extern void plpgsql_yyerror(const char *message); extern void plpgsql_yyerror(const char *message) pg_attribute_noreturn();
extern int plpgsql_location_to_lineno(int location); extern int plpgsql_location_to_lineno(int location);
extern int plpgsql_latest_lineno(void); extern int plpgsql_latest_lineno(void);
extern void plpgsql_scanner_init(const char *str); extern void plpgsql_scanner_init(const char *str);
......
...@@ -10,18 +10,11 @@ extern PyObject *PLy_exc_error; ...@@ -10,18 +10,11 @@ extern PyObject *PLy_exc_error;
extern PyObject *PLy_exc_fatal; extern PyObject *PLy_exc_fatal;
extern PyObject *PLy_exc_spi_error; extern PyObject *PLy_exc_spi_error;
extern void extern void PLy_elog(int elevel, const char *fmt,...) pg_attribute_printf(2, 3);
PLy_elog(int elevel, const char *fmt,...)
pg_attribute_printf(2, 3);
extern void extern void PLy_exception_set(PyObject *exc, const char *fmt,...) pg_attribute_printf(2, 3);
PLy_exception_set(PyObject *exc, const char *fmt,...)
pg_attribute_printf(2, 3);
extern void extern void PLy_exception_set_plural(PyObject *exc, const char *fmt_singular, const char *fmt_plural,
PLy_exception_set_plural(PyObject *exc, const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(2, 5) pg_attribute_printf(3, 5);
unsigned long n,...)
pg_attribute_printf(2, 5)
pg_attribute_printf(3, 5);
#endif /* PLPY_ELOG_H */ #endif /* PLPY_ELOG_H */
...@@ -40,6 +40,6 @@ extern void test_shm_mq_setup(int64 queue_size, int32 nworkers, ...@@ -40,6 +40,6 @@ extern void test_shm_mq_setup(int64 queue_size, int32 nworkers,
shm_mq_handle **input); shm_mq_handle **input);
/* Main entrypoint for a worker. */ /* Main entrypoint for a worker. */
extern void test_shm_mq_main(Datum) pg_attribute_noreturn; extern void test_shm_mq_main(Datum) pg_attribute_noreturn();
#endif #endif
...@@ -46,7 +46,7 @@ PG_MODULE_MAGIC; ...@@ -46,7 +46,7 @@ PG_MODULE_MAGIC;
PG_FUNCTION_INFO_V1(worker_spi_launch); PG_FUNCTION_INFO_V1(worker_spi_launch);
void _PG_init(void); void _PG_init(void);
void worker_spi_main(Datum) pg_attribute_noreturn; void worker_spi_main(Datum) pg_attribute_noreturn();
/* flags set by signal handlers */ /* flags set by signal handlers */
static volatile sig_atomic_t got_sighup = false; static volatile sig_atomic_t got_sighup = false;
......
...@@ -131,21 +131,9 @@ static int fail_ignore_count = 0; ...@@ -131,21 +131,9 @@ static int fail_ignore_count = 0;
static bool directory_exists(const char *dir); static bool directory_exists(const char *dir);
static void make_directory(const char *dir); static void make_directory(const char *dir);
static void static void header(const char *fmt,...) pg_attribute_printf(1, 2);
header(const char *fmt,...) static void status(const char *fmt,...) pg_attribute_printf(1, 2);
/* This extension allows gcc to check the format string for consistency with static void psql_command(const char *database, const char *query,...) pg_attribute_printf(2, 3);
the supplied arguments. */
pg_attribute_printf(1, 2);
static void
status(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(1, 2);
static void
psql_command(const char *database, const char *query,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
pg_attribute_printf(2, 3);
#ifdef WIN32 #ifdef WIN32
typedef BOOL (WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE); typedef BOOL (WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment