commit 6df2093d4d30ed07f0d0e4b0beeff73450d7c5e2
Author: Gianluca Sforna <giallu@gmail.com>
Date: Fri Jul 22 12:31:07 2016 +0200
Fix format-security GCC warning
In Fedora land, format-security GCC warnings are treated as errors
so the build would fail like this:
In file included from /usr/include/pgsql/server/postgres.h:48:0,
from rdkit.h:40,
from mol_op.c:33:
mol_op.c:339:19: error: format not a string literal and no format arguments [-Werror=format-security]
elog(WARNING, t);
^
diff --git a/Code/PgSQL/rdkit/mol_op.c b/Code/PgSQL/rdkit/mol_op.c
index 71a943b..f9326a5 100644
--- a/Code/PgSQL/rdkit/mol_op.c
+++ b/Code/PgSQL/rdkit/mol_op.c
@@ -351,10 +351,8 @@ Datum fmcs_mol2s_transition(PG_FUNCTION_ARGS) {
/// elog(WARNING, "fmcs_mol2s_transition() called first time");
CROMol mol = PG_GETARG_DATUM(1);
int len;
- char t[256];
- sprintf(t, "mol=%p, fcinfo: %p, %p", mol, fcinfo->flinfo->fn_extra,
+ elog(WARNING, "mol=%p, fcinfo: %p, %p", mol, fcinfo->flinfo->fn_extra,
fcinfo->flinfo->fn_mcxt);
- elog(WARNING, t);
fcinfo->flinfo->fn_extra =
SearchMolCache(fcinfo->flinfo->fn_extra, fcinfo->flinfo->fn_mcxt,
PG_GETARG_DATUM(1), NULL, &mol, NULL);
@@ -380,10 +378,8 @@ Datum fmcs_mol2s_transition(PG_FUNCTION_ARGS) {
// mol_to_smiles():
CROMol mol = PG_GETARG_DATUM(1);
int len;
- char t[256];
- sprintf(t, "mol=%p, fcinfo: %p, %p", mol, fcinfo->flinfo->fn_extra,
+ elog(WARNING, "mol=%p, fcinfo: %p, %p", mol, fcinfo->flinfo->fn_extra,
fcinfo->flinfo->fn_mcxt);
- elog(WARNING, t);
fcinfo->flinfo->fn_extra =
SearchMolCache(fcinfo->flinfo->fn_extra, fcinfo->flinfo->fn_mcxt,
PG_GETARG_DATUM(1), NULL, &mol, NULL);