[go: nahoru, domu]

Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Issue 339059: Add compiler-specific "examine printf format" attributes to printfs. (Closed)

Created:
11 years, 1 month ago by Evan Martin
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add compiler-specific "examine printf format" attributes to printfs. Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=32600

Patch Set 1 #

Total comments: 1

Patch Set 2 : work in progress #

Patch Set 3 : almost works #

Patch Set 4 : works on windows #

Total comments: 27

Patch Set 5 : works #

Total comments: 2

Patch Set 6 : cleanups #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+228 lines, -132 lines) Patch
M base/compiler_specific.h View 1 2 3 4 5 1 chunk +21 lines, -0 lines 0 comments Download
M base/format_macros.h View 4 3 chunks +13 lines, -2 lines 0 comments Download
M base/histogram.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M base/i18n/number_formatting.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M base/process_util.h View 2 3 1 chunk +6 lines, -6 lines 0 comments Download
M base/string_util.h View 1 2 3 4 chunks +26 lines, -10 lines 0 comments Download
M base/string_util_unittest.cc View 1 2 3 4 3 chunks +18 lines, -13 lines 1 comment Download
M base/trace_event.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M base/tracked_objects.cc View 1 2 3 4 2 chunks +6 lines, -4 lines 0 comments Download
M base/worker_pool_linux.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/app/chrome_dll_main.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 1 comment Download
M chrome/browser/bug_report_util.cc View 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 4 5 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context_unittest.cc View 2 3 4 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/net/dns_host_info.cc View 1 2 3 4 3 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_parser.cc View 1 2 3 4 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database_unittest.cc View 3 chunks +6 lines, -7 lines 1 comment Download
M chrome/common/child_process_info.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/extension_unittest.cc View 2 3 4 5 3 chunks +12 lines, -5 lines 2 comments Download
M courgette/adjustment_method_2.cc View 2 3 4 5 chunks +7 lines, -6 lines 0 comments Download
M media/base/video_frame_impl_unittest.cc View 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M media/filters/ffmpeg_glue.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M net/base/cookie_monster.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/host_cache_unittest.cc View 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M net/base/load_log_util.cc View 4 2 chunks +2 lines, -1 line 0 comments Download
M net/base/net_util_unittest.cc View 2 3 4 4 chunks +10 lines, -10 lines 0 comments Download
M net/disk_cache/sparse_control.cc View 1 2 3 2 chunks +3 lines, -2 lines 1 comment Download
M net/ftp/ftp_directory_listing_buffer_unittest.cc View 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M net/ftp/ftp_directory_listing_parsers_unittest.cc View 2 3 4 5 chunks +5 lines, -4 lines 0 comments Download
M net/http/http_cache.cc View 1 2 3 4 2 chunks +5 lines, -2 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 2 chunks +2 lines, -1 line 1 comment Download
M net/http/partial_data.cc View 1 2 3 3 chunks +5 lines, -3 lines 2 comments Download
M net/proxy/proxy_config_service_linux_unittest.cc View 2 3 4 5 chunks +9 lines, -6 lines 0 comments Download
M net/proxy/proxy_service_unittest.cc View 2 3 4 3 chunks +4 lines, -2 lines 0 comments Download
M net/url_request/request_tracker_unittest.cc View 4 3 chunks +3 lines, -2 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 2 3 4 3 chunks +5 lines, -4 lines 0 comments Download
M net/url_request/url_request_view_net_internals_job.cc View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M webkit/glue/dom_serializer.cc View 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M webkit/glue/media/buffered_data_source_unittest.cc View 2 3 3 chunks +4 lines, -2 lines 2 comments Download
M webkit/glue/media/media_resource_loader_bridge_factory.cc View 2 chunks +5 lines, -3 lines 2 comments Download

Messages

Total messages: 14 (0 generated)
Evan Martin
Please don't review in detail yet, since I haven't tried it on win/mac due to ...
11 years, 1 month ago (2009-10-29 01:18:26 UTC) #1
Mark Mentovai
I didn't look at the whole thing (because you said not to) but I like ...
11 years, 1 month ago (2009-10-29 01:26:34 UTC) #2
TVL
drive by http://codereview.chromium.org/339059/diff/1/2 File base/compiler_specific.h (right): http://codereview.chromium.org/339059/diff/1/2#newcode76 Line 76: // |dots_param| is the one-base index ...
11 years, 1 month ago (2009-10-29 01:57:05 UTC) #3
Evan Martin
On 2009/10/29 01:57:05, TVL wrote: > http://codereview.chromium.org/339059/diff/1/2#newcode76 > Line 76: // |dots_param| is the one-base ...
11 years, 1 month ago (2009-10-29 02:00:26 UTC) #4
Evan Martin
this doesn't work because %z doesn't work on windows. I need to use %I, which ...
11 years, 1 month ago (2009-11-12 20:26:29 UTC) #5
Evan Martin
I think I figured out the Windows problem, so this is ready for review.
11 years, 1 month ago (2009-11-14 04:57:07 UTC) #6
Mark Mentovai
http://codereview.chromium.org/339059/diff/8001/9001 File base/compiler_specific.h (right): http://codereview.chromium.org/339059/diff/8001/9001#newcode74 Line 74: // Annotate a function that it's using a ...
11 years, 1 month ago (2009-11-14 16:31:21 UTC) #7
Evan Martin
Thanks for the careful review. I unfortunately had to rebase to continue running this on ...
11 years, 1 month ago (2009-11-16 23:47:32 UTC) #8
Evan Martin
ping
11 years, 1 month ago (2009-11-17 19:58:53 UTC) #9
Mark Mentovai
http://codereview.chromium.org/339059/diff/12001/13001 File base/compiler_specific.h (right): http://codereview.chromium.org/339059/diff/12001/13001#newcode74 Line 74: // Annotate a function that it's using a ...
11 years, 1 month ago (2009-11-18 07:52:20 UTC) #10
Evan Martin
On 2009/11/18 07:52:20, Mark Mentovai wrote: > I was going to start reviewing this (late, ...
11 years, 1 month ago (2009-11-18 18:02:11 UTC) #11
Mark Mentovai
LGTM http://codereview.chromium.org/339059/diff/15001/15008 File base/string_util_unittest.cc (right): http://codereview.chromium.org/339059/diff/15001/15008#newcode919 Line 919: static void StringAppendVTestHelper(std::string* out, Maybe mark this ...
11 years, 1 month ago (2009-11-18 20:55:27 UTC) #12
Evan Martin
On 2009/11/18 20:55:27, Mark Mentovai wrote: > LGTM Jeez, you'd think I could grep for ...
11 years, 1 month ago (2009-11-18 21:57:37 UTC) #13
Evan Martin
11 years, 1 month ago (2009-11-18 22:06:24 UTC) #14
When I was just done with your comments, I did the greps I should have done last
time, and noticed I again missed one of your comments from this round.  So maybe
that's why I've been doing so poorly in the past.

Running through trybots now.

Powered by Google App Engine
This is Rietveld 408576698