i'm using the sqlite library for a project. one way to execute sql
calls is to use this function:
int sqlite_exec_printf(sqlite *db,
char *sqlfmt,
int (*xCallback)(void*,int,char**,char**),
void *pArg,
char **errmsg,
...);
with gcc you can tell the compiler and it can let you know if there's
a problem when that function is called. so if the sqlite.h proto type
for this function was defined with that attribute it would give those
warnings for it.
int sqlite_exec_printf(sqlite *db,
char *sqlfmt,
int (*xCallback)(void*,int,char**,char**),
void *pArg,
char **errmsg,
...) __attribute__((format(printf, 2, 6)));
that says that this function has a format string that uses a printf
style. the format string is the second arg; the args to it begin at arg
6.
however. there's a flaw. sqlite_exec_printf()'s sqlfmt string has two
additional % escapes: %q and %Q. they're like %s except that they
escape the string for sql (%q) and enclose it in single quotes (%Q).
i've read through the gcc docs and as far as i can see, i'd need to
change gcc in order to support new % format codes. am i missing
something?
kevin
--
kevin lyda ~ dems for torture: salazar(co/10) landrieu(la/08) pryor(ar/08)
kevin at ie.suberic.net ~ nelson(fl/06) nelson(ne/06) lieberman(ct/06) 2/2/04
Those who refuse to raise their voices against something as clearly evil
as torture are enablers, if not collaborators. --Bob Herbert, 2/11/04
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!