Closed Bug 1392684 Opened 7 years ago Closed 7 years ago

Type Qualifiers discarded after return of ObtainGit

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

Details

(Whiteboard: [tor])

Attachments

(1 file)

>  /home/worker/workspace/build/src/ipc/mscom/AgileReference.cpp:138:79: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
>     static IGlobalInterfaceTable * const sGit = []() -> IGlobalInterfaceTable * const {
Attachment #8899900 - Flags: review?(jld)
I don't understand what this warning is warning about — sGit is constant, yes, but forbidding any copy of the pointer value to be stored in a mutable variable seems unhelpful.  (The const qualifier is on the pointer type itself, not the pointer target.)
Attachment #8899900 - Flags: review?(jld) → review?(aklotz)
This seems harmless, but I'd rather it be looked at by someone who knows this specific code.
Comment on attachment 8899900 [details]
Bug 1392684 Remove const qualifier that gets discarded after function return in mscom::AgileReference

https://reviewboard.mozilla.org/r/171230/#review176406

::: commit-message-de25e:1
(Diff revision 1)
> +Bug 1392684 Propogate const qualifier out to function return and all callers

Can you please provide a more specific commit message? Adding that you're modifying mscom::AgileReference would suffice.
Attachment #8899900 - Flags: review?(aklotz) → review+
(In reply to Jed Davis [:jld] (⏰UTC-6) from comment #3)
> I don't understand what this warning is warning about — sGit is constant,
> yes, but forbidding any copy of the pointer value to be stored in a mutable
> variable seems unhelpful.  (The const qualifier is on the pointer type
> itself, not the pointer target.)

Indeed, I misunderstood it. The error is saying "You're declaring this const, but nothing is going to obey that. The const is misleading and superfluous."

Re-flagging :aklotz for re-review since this is a meaningful change from the original patch.

New try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d22e9169052e0996db6008f5a7fa3e1c6a648bc0
Flags: needinfo?(aklotz)
Comment on attachment 8899900 [details]
Bug 1392684 Remove const qualifier that gets discarded after function return in mscom::AgileReference

https://reviewboard.mozilla.org/r/171230/#review176514

::: ipc/mscom/AgileReference.cpp:138
(Diff revision 4)
>  IGlobalInterfaceTable*
>  AgileReference::ObtainGit()
>  {
>    // Internally to COM, the Global Interface Table is a singleton, therefore we
>    // don't worry about holding onto this reference indefinitely.
> -  static IGlobalInterfaceTable * const sGit = []() -> IGlobalInterfaceTable * const {
> +  static IGlobalInterfaceTable * sGit = []() -> IGlobalInterfaceTable * {

Nit: Remove space between IGlobalInterfaceTable and '*'
Flags: needinfo?(aklotz)
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/acae3198b087
Remove const qualifier that gets discarded after function return in mscom::AgileReference r=aklotz
https://hg.mozilla.org/mozilla-central/rev/acae3198b087
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
No longer blocks: 1330608
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: