Closed Bug 845503 Opened 7 years ago Closed 7 years ago

While building BitSet.cpp, "jsscript.h:866:30: warning: inline function 'js::RegExpObject* JSScript::getRegExp(size_t)' used but never defined [enabled by default]" and similar for JSScript::getFunction

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 840339

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

While building BitSet.cpp, I get the following build warning spam:
{
In file included from js/src/vm/SPSProfiler.h:18:0,
                 from js/src/jscntxt.h:37,
                 from js/src/ion/IonAllocPolicy.h:13,
                 from js/src/ion/BitSet.h:11,
                 from js/src/ion/BitSet.cpp:9:
Warning: enabled by default in js/src/jsscript.h: inline function 'js::RegExpObject* JSScript::getRegExp(size_t)' used but never defined
js/src/jsscript.h:866:30: warning: inline function 'js::RegExpObject* JSScript::getRegExp(size_t)' used but never defined [enabled by default]

Warning: enabled by default in js/src/jsscript.h: inline function 'JSFunction* JSScript::getFunction(size_t)' used but never defined
js/src/jsscript.h:862:24: warning: inline function 'JSFunction* JSScript::getFunction(size_t)' used but never defined [enabled by default]
}

(I also get the warnings for bug 845226. That bug has a patch, though, and the warnings reported here don't go away with that bug's patch.)
The first affected cset is:
{
The first bad revision is:
changeset:   122573:69a9bb6f645a
user:        Nicholas D. Matsakis <nmatsakis@mozilla.com>
date:        Tue Feb 19 09:18:43 2013 -0500
summary:     Bug 842723 - Remove incorrect inlines.h include r=dvander
}
Blocks: 842723
(I'm using GCC 4.7.2 on Ubuntu 13.04 prerelease, FWIW)
|#include "jsscriptinlines.h"| needs to be added to BitSet.cpp.  I'll upload a patch.
I apologize for these warnings.  I'm not sure whether my compiler generates them or not, but I'll try to be more vigilant!
No worries, thanks for the quick turnaround on them!

Also: This affects more than just BitSet.cpp. I'll try to get a complete list of the files that trigger this build warning.
Attachment #718641 - Flags: review?(dvander)
I didn't see any warnings with that patch, but you may want to verify for yourself.
Flags: needinfo?(dholbert)
Comment on attachment 718641 [details] [diff] [review]
Add missing include.

Review of attachment 718641 [details] [diff] [review]:
-----------------------------------------------------------------

Seems kind of bogus that we have to include this, is GCC not good at seeing what's actually used?
Attachment #718641 - Flags: review?(dvander) → review+
Here's the list of .cpp files that suffer from these exact build warnings, on my machine (w/ up-to-date m-i):
 BitSet.cpp
 IonSpewer.cpp
 MoveResolver.cpp
 IonFrames-x86-shared.cpp
Flags: needinfo?(dholbert)
> Seems kind of bogus that we have to include this, is GCC not good at seeing
> what's actually used?

I think it *is* actually used, but it's probably in one of the various headers rather than in the .cpp file itself.
It looks like CompileInfo.h is probably the header in question.  It invokes both of these methods (in its own non-inline methods), and it doesn't include anything.

Here's where it calls these methods:
85     RegExpObject *getRegExp(jsbytecode *pc) const {
86         return script_->getRegExp(GET_UINT32_INDEX(pc));
87     }
[...]
91     JSFunction *getFunction(jsbytecode *pc) const {
92         return script_->getFunction(GET_UINT32_INDEX(pc));
93     }
https://mxr.mozilla.org/mozilla-central/source/js/src/ion/CompileInfo.h#85
Actually, this is effectively a dupe of bug 840339, which *was* fixed but which bug 842723 (the regressing changeset) un-fixed.
Duping to bug 845503 (which I've reopened, since its patch was backed out).
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 840339
(In reply to Daniel Holbert [:dholbert] from comment #13)
> Duping to bug 845503 (which I've reopened, since its patch was backed out).

Er, that's this bug here -- I of course meant "Duping to bug 840339". :)
You need to log in before you can comment on or make changes to this bug.