--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
For more context, here's the CL that's currently under review: https://codereview.chromium.org/1997153002/In that CL, a lot of function definitions get changed in the following manner:bool SampleCountIterator::GetBucketIndex(size_t* index) const {to:bool SampleCountIterator::GetBucketIndex(size_t* /*index*/) const {I raised the concern that this does not match currently convention in Chromium browser code and even though it is allowed by Google C++ Style Guide (just like other things that the guide allows but we don't do - such as writing "Foo *bar" instead of "Foo* bar"), we shouldn't just do this in Chromium before there's consensus on chromium-dev@ that we should.So what do others think? Should we allow this and have an inconsistency where some files use this convention or others don't?Personally, I prefer writing out the parameters so its obvious what the mean (i.e. not just omitting them) and the extra /**/ comment is just extra noise on top compared to just having the param name. But I'm happy to bend my opinion if there's support for allowing it.-Alexei
On Tue, May 24, 2016 at 7:35 PM, Luis Hector <lhch...@chromium.org> wrote:Hi,--I'm uprevving libchrome[1] in AOSP and since Android is built with different warning enabled, there is a large set of local patches that make updating to ToT Chrome difficult and time-consuming. Since I'd like to make the next uprevver's life easier, I have an open review[2] that upstreams some of the modifications that make sense, and complies with Google's C++ style[3], but I was suggested to post here to discuss one type of changes in particular:Android builds with -Wunused-*, whereas Chromium does not. Google's style guide in https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions mentions that "Unused parameters that are obvious from context may be omitted [... and ...] Unused parameters that might not be obvious should comment out the variable name in the function definition". I did find a few places here and there in components/, content/, chrome/, where this happens[4], but the vast majority of places add the parameter name even if it is unused.While I can probably try to push to add -Wno-unused-* in AOSP side to avoid the need for these changes, there are still some headers that get included in other projects, and adding those flags in more places is going to be a tough sell, so the easiest thing is still to try to uprev these changes to Chrome.Looking for guidance and suggestions,Luis4: ag '[&*]\) .*{' -G cc$ components content chrome shows ~hundreds of matches, although some are false positives.
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
On Wed, May 25, 2016 at 10:10 AM, Alexei Svitkine <asvi...@chromium.org> wrote:For more context, here's the CL that's currently under review: https://codereview.chromium.org/1997153002/In that CL, a lot of function definitions get changed in the following manner:bool SampleCountIterator::GetBucketIndex(size_t* index) const {to:bool SampleCountIterator::GetBucketIndex(size_t* /*index*/) const {I raised the concern that this does not match currently convention in Chromium browser code and even though it is allowed by Google C++ Style Guide (just like other things that the guide allows but we don't do - such as writing "Foo *bar" instead of "Foo* bar"), we shouldn't just do this in Chromium before there's consensus on chromium-dev@ that we should.So what do others think? Should we allow this and have an inconsistency where some files use this convention or others don't?Personally, I prefer writing out the parameters so its obvious what the mean (i.e. not just omitting them) and the extra /**/ comment is just extra noise on top compared to just having the param name. But I'm happy to bend my opinion if there's support for allowing it.-AlexeiThe names of unused parameters are mostly useful to the readers of the interface. Could a compromise be to leave the name in the declaration, but omit them in the function definition? Assuming that doesn't trigger the warning of course.Antoine
--
P.S. we have that macro already in base/macros.h, it's not a macro and is called ignore_result ;-)
--