Closed Bug 1080000 Opened 10 years ago Closed 10 years ago

LIR-Common.h:197:5: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers], for "const SimdLane lane() const {"

Categories

(Core :: JavaScript Engine: JIT, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1044256

People

(Reporter: dholbert, Unassigned)

References

Details

Recently-introduced build warning, with clang 3.5:
{
In file included from $OBJDIR/js/src/Unified_cpp_js_src0.cpp:54:
In file included from $SRCDIR/js/src/asmjs/AsmJSValidate.cpp:37:
In file included from $SRCDIR/js/src/jit/CodeGenerator.h:18:
In file included from $SRCDIR/js/src/jit/x64/CodeGenerator-x64.h:10:
In file included from $SRCDIR/js/src/jit/shared/CodeGenerator-x86-shared.h:10:
In file included from $SRCDIR/js/src/jit/shared/CodeGenerator-shared.h:14:
In file included from $SRCDIR/js/src/jit/LIR.h:1675:
Warning: -Wignored-qualifiers in $SRCDIR/js/src/jit/LIR-Common.h: 'const' type qualifier on return type has no effect
$SRCDIR/js/src/jit/LIR-Common.h:197:5: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
    const SimdLane lane() const {
    ^~~~~~
}

It looks like SimdLane is an enum, and we're returning it by value, so returning a const value is no different from returning a non-const value (since the caller will make a copy of it anyway).  I think that's what the warning is trying to say, at least...
(Looks like this chunk of LIR-Common.h was added in bug 1025100, last month:
  http://hg.mozilla.org/mozilla-central/rev/d418a4d0f8d5#l1.28
Not sure why I'm only just noticing it now for the first time; maybe the code was disabled in my build configuration for some reason, until now? Doesn't really matter, I suppose.)

bbouvier, could you take a look at this & drop the 'const' if appropriate?
Depends on: 1025100
Flags: needinfo?(benj)
Thanks for the report, fixed as drive-by in https://hg.mozilla.org/integration/mozilla-inbound/rev/2ae98c304c5e
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(benj)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.