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

Issue 1218243002: Fix some clang warnings with -Wmissing-braces in base. (Closed)

Created:
5 years, 5 months ago by dcheng
Modified:
5 years, 5 months ago
Reviewers:
Nico, Ryan Sleevi
CC:
chromium-reviews, erikwright+watch_chromium.org, grt+watch_chromium.org, sadrul, tracing+reviews_chromium.org, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix some clang warnings with -Wmissing-braces in base. Clang warns if there are missing braces around a subobject initializer. The most common idiom that triggers this is: STRUCT s = {0}; if the first field of STRUCT is itself a struct. This can be more simply written as: STRUCT s = {}; which also prevents the warning from firing. BUG=505297 Committed: https://crrev.com/e74809cbb56e2ad906e0fbca6f97935242d3ed5f Cr-Commit-Position: refs/heads/master@{#337139}

Patch Set 1 #

Total comments: 7

Patch Set 2 : simplify #

Patch Set 3 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -57 lines) Patch
M base/file_version_info_unittest.cc View 1 1 chunk +36 lines, -40 lines 0 comments Download
M base/files/memory_mapped_file_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/process/launch_win.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/profiler/stack_sampling_profiler_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/third_party/nspr/prtime.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M base/time/time_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/trace_event_win.cc View 1 chunk +12 lines, -4 lines 0 comments Download
M base/win/scoped_comptr_unittest.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M base/win/scoped_variant.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/win/windows_version.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 19 (6 generated)
dcheng
https://codereview.chromium.org/1218243002/diff/1/base/win/scoped_variant.cc File base/win/scoped_variant.cc (right): https://codereview.chromium.org/1218243002/diff/1/base/win/scoped_variant.cc#newcode12 base/win/scoped_variant.cc:12: const VARIANT ScopedVariant::kEmptyVariant = {{{VT_EMPTY}}}; FWIW, 100% of the ...
5 years, 5 months ago (2015-07-01 18:27:34 UTC) #2
Nico
Note that `STRUCT s = {0};` only warns if the first element of s is ...
5 years, 5 months ago (2015-07-01 18:36:51 UTC) #3
Nico
lgtm https://codereview.chromium.org/1218243002/diff/1/base/file_version_info_unittest.cc File base/file_version_info_unittest.cc (right): https://codereview.chromium.org/1218243002/diff/1/base/file_version_info_unittest.cc#newcode39 base/file_version_info_unittest.cc:39: const wchar_t* kExpectedValues[1][15] = {{ nit: const wchar_t* ...
5 years, 5 months ago (2015-07-01 18:40:49 UTC) #4
dcheng
https://codereview.chromium.org/1218243002/diff/1/base/file_version_info_unittest.cc File base/file_version_info_unittest.cc (right): https://codereview.chromium.org/1218243002/diff/1/base/file_version_info_unittest.cc#newcode39 base/file_version_info_unittest.cc:39: const wchar_t* kExpectedValues[1][15] = {{ On 2015/07/01 at 18:40:48, ...
5 years, 5 months ago (2015-07-01 21:26:39 UTC) #5
Nico
lgtm, but let the base/third_party/nspr/OWNERS know I guess
5 years, 5 months ago (2015-07-01 21:30:13 UTC) #6
dcheng
+rsleevi for nspr changes.
5 years, 5 months ago (2015-07-01 21:36:05 UTC) #8
Ryan Sleevi
lgtm
5 years, 5 months ago (2015-07-01 22:07:20 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1218243002/20001
5 years, 5 months ago (2015-07-01 22:09:27 UTC) #11
commit-bot: I haz the power
Exceeded global retry quota
5 years, 5 months ago (2015-07-01 22:12:23 UTC) #13
Nico
I think this means "patch failed to apply". From one of these bots: error: patch ...
5 years, 5 months ago (2015-07-01 22:17:14 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1218243002/40001
5 years, 5 months ago (2015-07-01 22:52:50 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 5 months ago (2015-07-02 00:07:49 UTC) #18
commit-bot: I haz the power
5 years, 5 months ago (2015-07-02 00:08:53 UTC) #19
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/e74809cbb56e2ad906e0fbca6f97935242d3ed5f
Cr-Commit-Position: refs/heads/master@{#337139}

Powered by Google App Engine
This is Rietveld 408576698