Closed Bug 748237 Opened 13 years ago Closed 13 years ago

It's not possible to include a header using jshashtable from any dir that uses FAIL_ON_WARNINGS=1 due to android bustage in MoveRef

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Background: Android builds in c++11 mode. So this code in MoveRef gets compiled: operator T&& () const { return static_cast<T&&>(*pointer); } which leads to this lovely warning: ../../../dist/include/js/Utility.h:860: warning: returning reference to temporary and in particular it happens due to this chain of template instantiations: ../../../dist/include/js/Utility.h: In member function 'js::MoveRef<T>::operator T&&() const [with T = JSObject*]': ../../../dist/include/js/HashTable.h:916: instantiated from 'void js::HashMapEntry.... ../../../dist/include/js/HashTable.h:84: instantiated from 'void js::detail::HashTableEntry<T>::operator=(js::MoveRef<js::detail::HashTableEntry<T> >) ../../../dist/include/js/HashTable.h:595: instantiated from 'bool js::detail::HashTable<T, HashPolicy, AllocPolicy>::changeTableSize(int) ../../../dist/include/js/HashTable.h:635: instantiated from 'bool js::detail::HashTable<T, HashPolicy, AllocPolicy>::checkOverloaded() ../../../dist/include/js/HashTable.h:263: instantiated from 'js::detail::HashTable<T, HashPolicy, AllocPolicy>::Enum::~Enum() /builds/slave/try-andrd-xul/build/js/xpconnect/wrappers/../src/XPCMaps.h:752: instantiated from here Sadly, XPCMaps.h is includes by xpcprivate.h, which is included by XPCQuickStubs.h, which is included by the new-binding Utils.h. So trying to use new-bindings in any dir that has FAIL_ON_WARNINGS makes it fail on Android. That said, the warning here sounds pretty bad. Is it really meant to be happening?
This compiles locally for me with clang and passes a try push on Android
Whiteboard: [need review]
Attachment #618462 - Flags: review?(luke)
Assignee: general → bzbarsky
Comment on attachment 618462 [details] [diff] [review] Only do the c++11 stuff for clang here, since otherwise we get scary warnings with gcc on android. Right on.
Attachment #618462 - Flags: review?(luke) → review+
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla15
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: