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 <bertranddrouvot.pg@gmail.com>
Reported-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Diagnosed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAN55FZ1VDwJ-ZD092ChYf%2B%2BhuP%2B-S3Cg45tJ8jNH5wx2c4BHAg%40mail.gmail.com
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);
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