[Linux-ha-dev] Re: [Linux-ha-cvs] riloe plugin commit
alanr at unix.sh
Mon Oct 4 13:40:51 MDT 2004
Lars Ellenberg wrote:
> / 2004-10-04 13:38:58 -0500
> \ Guochun Shi:
>>I did compile it with -Wformat=2 (which is the default) and got no warnings/errors.
>>I use gcc-3.2.2
> gcc -v
> gcc-Version 3.3.1 (SuSE Linux)
> maybe in 3.2.2, -Wformat-nonliteral is not yet included in -Wformat=2 ?
>>>what I wanted to say, maybe better do it like this:
>>>diff -u -p -r1.1 riloe.c
>>>--- lib/plugins/stonith/riloe.c 1 Oct 2004 20:12:49 -0000 1.1
>>>+++ lib/plugins/stonith/riloe.c 2 Oct 2004 05:17:03 -0000
>>>@@ -311,7 +311,7 @@ riloe_reset_req(Stonith * s, int request
>>> syslog(LOG_ERR, "invalid argument to %s", __FUNCTION__);
>>>- syslog(LOG_INFO, _("Host %s riloe-reset."), host);
>>>+ syslog(LOG_INFO, "%s '%s'", _("riloe-reset host"), host);
>>> sprintf(cmd, "%s %s reset", RILOE_COMMAND, host);
>>is this the only line that does not compile?
>>What about other syslog(LOG_ERR, ....)?
> find . -name "*.[ch]" | xargs grep "log("
> all use constant strings. if they are i18n, they do something similar
> to what I did above.
> e.g. do
> for f in `find . -name "*.[ch]"` ; do
> indent -l1024 -nhnl < $f | sed "s§^§$f:§"
> done 2>/dev/null | grep -i "\(printf\|log\) *(.*\<_("
> (apparently the stonith plugins are the only place where i18n is used,
> or at least where the _("") thingy is used in log or printf functions.
> but that loop above finds 79 lines, and they all use a string literal in
> the strict sense as format argument, and have the i18n strings as %s
Somehow this only happens if you enable ANSI.
Alan Robertson <alanr at unix.sh>
"Openness is the foundation and preservative of friendship... Let me claim
from you at all times your undisguised opinions." - William Wilberforce
More information about the Linux-HA-Dev