[libav-devel] [PATCH 7/8] checkasm: add HEVC MC tests

Clément Bœsch u at pkh.me
Fri Aug 21 07:50:43 CEST 2015


On Fri, Aug 21, 2015 at 06:31:22AM +0200, Luca Barbato wrote:
> On 20/08/15 22:37, Henrik Gramner wrote:
> >> +        report("%s", "qpel");
> >> +        report("%s", "epel");
> >> +        report("%s", "unweighted_pred");
> >> +        report("%s", "weighted_pred");
> > 
> > The "%s" is redundant with string literals.
> 
> It is good practice do always do that and recent compilers do warn you
> if you pass string literals directly to printf-like functions.
> 

printf(s) will obviously warn for security reasons, but printf("foo")
won't obviously...

> Incidentally printf("%s", "string") is faster than printf("string")
> since the parser needs to go through 2 chars for those that are versed
> to speed optimization ^^.

except when printf("foo") is actually replaced by puts("foo") by your
compiler (which might be harder to do with a "%s","foo" form)

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.libav.org/pipermail/libav-devel/attachments/20150821/b2513cb9/attachment.sig>


More information about the libav-devel mailing list