New issue
Advanced search Search tips

Issue 706428 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: 2017-04-05
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Compiler warning in printing/backend/cups_jobs.cc

Project Member Reported by jamescook@chromium.org, Mar 29 2017

Issue description

When using go/simplechrome:

cros chrome-sdk --log-level=debug --board=link
mkdir -p out_link/Release
gn gen out_link/Branded --args="$GN_ARGS is_chrome_branded=true"
ninja -C out_link/Branded -j500 -l30 chrome chrome_sandbox nacl_helper

../../printing/backend/cups_jobs.cc:89:5: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    kPrinterState, kPrinterStateReasons, kPrinterStateMessage};

I don't understand why it's warning -- it seems like the right sort of initializer list for std::array. Maybe it's confused by const char foo[] vs const char* const.

 

Comment 1 by skau@chromium.org, Mar 29 2017

Status: Started (was: Assigned)

Comment 2 by skau@chromium.org, Mar 29 2017

It seems like brace elision is supposed to be allowable on the right side of an equals.  But clang doesn't like it.  This is an example of aggregate initialization which seems to have some funny rules.

http://en.cppreference.com/w/cpp/language/aggregate_initialization

Comment 3 by skau@chromium.org, Mar 31 2017

Cc: achuith@chromium.org skau@chromium.org
 Issue 707323  has been merged into this issue.

Comment 4 by skau@chromium.org, Mar 31 2017

NextAction: 2017-04-05
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74cea7ee6f641c6f59970a45bc6a5ec334020131

commit 74cea7ee6f641c6f59970a45bc6a5ec334020131
Author: skau <skau@chromium.org>
Date: Thu Apr 06 00:23:56 2017

Fix style for aggregate initializer.

Appease clang when run with -Wmissing-braces.  By rule, the braces can be elided but since std::array is an array wrapped in a struct, it produces a warning.

BUG= 706428 

Review-Url: https://codereview.chromium.org/2784083002
Cr-Commit-Position: refs/heads/master@{#462291}

[modify] https://crrev.com/74cea7ee6f641c6f59970a45bc6a5ec334020131/printing/backend/cups_jobs.cc

Comment 6 by skau@chromium.org, Apr 6 2017

Status: Fixed (was: Started)

Comment 7 by dchan@google.com, May 30 2017

Labels: VerifyIn-60

Comment 8 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 9 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment