From: Tom Lane Date: Wed, 18 Mar 2026 19:25:12 +0000 (-0400) Subject: Fix -Wstrict-prototypes warning in ecpg_init_sqlca() declaration. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f91b8ff6af910744e6e317c5c2bc2698addde59a;p=thirdparty%2Fpostgresql.git Fix -Wstrict-prototypes warning in ecpg_init_sqlca() declaration. When headerscheck compiles ecpglib_extern.h, POSTGRES_ECPG_INTERNAL is not defined, causing sqlca.h to expand "sqlca" as a macro (*ECPGget_sqlca()). This causes the ecpg_init_sqlca() declaration to trigger a -Wstrict-prototypes warning. Fix by renaming the parameter from "sqlca" to "sqlca_p" in both the declaration and definition, avoiding the macro expansion. Author: Bertrand Drouvot Reported-by: Nazir Bilal Yavuz Diagnosed-by: Tom Lane Discussion: https://postgr.es/m/CAN55FZ1VDwJ-ZD092ChYf%2B%2BhuP%2B-S3Cg45tJ8jNH5wx2c4BHAg%40mail.gmail.com --- diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h index bea1398fce8..c92f0aa1081 100644 --- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h +++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h @@ -218,7 +218,7 @@ void ecpg_log(const char *format,...) pg_attribute_printf(1, 2); bool ecpg_auto_prepare(int lineno, const char *connection_name, const int compat, char **name, const char *query); bool ecpg_register_prepared_stmt(struct statement *stmt); -void ecpg_init_sqlca(struct sqlca_t *sqlca); +void ecpg_init_sqlca(struct sqlca_t *sqlca_p); struct sqlda_compat *ecpg_build_compat_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat); diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index 1885732a652..40ea174ae9f 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -64,9 +64,9 @@ static volatile int simple_debug = 0; static FILE *debugstream = NULL; void -ecpg_init_sqlca(struct sqlca_t *sqlca) +ecpg_init_sqlca(struct sqlca_t *sqlca_p) { - memcpy(sqlca, &sqlca_init, sizeof(struct sqlca_t)); + memcpy(sqlca_p, &sqlca_init, sizeof(struct sqlca_t)); } bool