Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1355)

Issue 6375043: Enable gcc & clang's format string checking on SkString (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by Stephen White
Modified:
11 years, 11 months ago
Reviewers:
TomH, bsalomon, reed1
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Add an SK_PRINTF_LIKE macro, which declares a function to have printf-like semantics, allowing gcc and clang to check the format string against the arguments. Also define an SK_SIZE_T_SPECIFIER macro so there's a cross-platform way of printing a size_t. Note: since the functions on SkString are non-static member functions, the parameters must offset by one in this case to accomodate the "this" argument, which is why they're (2, 3) and not (1, 2). This turned up a number of bugs; I've fixed the obvious ones, but where I wasn't sure, I left them in. These are: ../bench/ShaderMaskBench.cpp:55: warning: too many arguments for format (should we omit the argument, or add it to the format string?) ../tests/MathTest.cpp:202: warning: too few arguments for format One is missing, but which argument belongs to which format string?

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -10 lines) Patch
bench/MemoryBench.cpp View 1 chunk +1 line, -1 line 0 comments Download
experimental/Debugger/SkDebugDumper.cpp View 1 chunk +1 line, -1 line 0 comments Download
include/core/SkPostConfig.h View 1 chunk +20 lines, -0 lines 1 comment Download
include/core/SkString.h View 1 chunk +3 lines, -3 lines 0 comments Download
samplecode/SampleSlides.cpp View 1 chunk +1 line, -1 line 0 comments Download
src/gpu/gl/GrGLProgram.cpp View 1 chunk +1 line, -1 line 2 comments Download
src/utils/SkDumpCanvas.cpp View 1 chunk +3 lines, -3 lines 1 comment Download

Messages

Total messages: 5
Stephen White
11 years, 11 months ago (2012-07-09 16:00:41 UTC) #1
TomH
LGTM. +brian in case nit in GrGLProgram really is important http://codereview.appspot.com/6375043/diff/1/src/gpu/gl/GrGLProgram.cpp File src/gpu/gl/GrGLProgram.cpp (right): http://codereview.appspot.com/6375043/diff/1/src/gpu/gl/GrGLProgram.cpp#newcode521 ...
11 years, 11 months ago (2012-07-09 17:42:30 UTC) #2
bsalomon
http://codereview.appspot.com/6375043/diff/1/src/gpu/gl/GrGLProgram.cpp File src/gpu/gl/GrGLProgram.cpp (right): http://codereview.appspot.com/6375043/diff/1/src/gpu/gl/GrGLProgram.cpp#newcode521 src/gpu/gl/GrGLProgram.cpp:521: segments.fHeader.append(GrGetGLSLVersionDecl(gl.binding(), On 2012/07/09 17:42:30, TomH wrote: > I think ...
11 years, 11 months ago (2012-07-09 18:02:38 UTC) #3
reed1
http://codereview.appspot.com/6375043/diff/1/include/core/SkPostConfig.h File include/core/SkPostConfig.h (left): http://codereview.appspot.com/6375043/diff/1/include/core/SkPostConfig.h#oldcode292 include/core/SkPostConfig.h:292: We these be indented to show the nested levels ...
11 years, 11 months ago (2012-07-09 18:36:13 UTC) #4
Stephen White
11 years, 11 months ago (2012-07-09 20:57:44 UTC) #5
Landed in r4485; closing.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b