Closed Bug 896061 Opened 13 years ago Closed 13 years ago

GCC 4.7 compiler errors caused by non-standard name lookup

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: botond, Unassigned)

Details

When trying to build B2G with GCC 4.7, I get the following errors: frameworks/base/include/utils/KeyedVector.h: In instantiation of ‘const VALUE& android::DefaultKeyedVector<KEY, VALUE>::valueFor(const KEY&) const [with KEY = android::String8; VALUE = android::sp<AaptSymbols>]’: frameworks/base/tools/aapt/AaptAssets.h:446:59: required from here frameworks/base/include/utils/KeyedVector.h:196:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] frameworks/base/include/utils/KeyedVector.h:196:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptSymbols> >’ are not found by unqualified lookup frameworks/base/include/utils/KeyedVector.h:196:31: note: use ‘this->indexOfKey’ instead frameworks/base/include/utils/KeyedVector.h: In instantiation of ‘const VALUE& android::DefaultKeyedVector<KEY, VALUE>::valueFor(const KEY&) const [with KEY = android::String8; VALUE = android::sp<AaptGroup>]’: frameworks/base/tools/aapt/AaptAssets.cpp:1636:41: required from here frameworks/base/include/utils/KeyedVector.h:196:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] frameworks/base/include/utils/KeyedVector.h:196:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptGroup> >’ are not found by unqualified lookup frameworks/base/include/utils/KeyedVector.h:196:31: note: use ‘this->indexOfKey’ instead frameworks/base/include/utils/KeyedVector.h: In instantiation of ‘const VALUE& android::DefaultKeyedVector<KEY, VALUE>::valueFor(const KEY&) const [with KEY = android::String8; VALUE = android::sp<AaptDir>]’: frameworks/base/tools/aapt/AaptAssets.cpp:1700:53: required from here frameworks/base/include/utils/KeyedVector.h:196:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] frameworks/base/include/utils/KeyedVector.h:196:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup frameworks/base/include/utils/KeyedVector.h:196:31: note: use ‘this->indexOfKey’ instead The cause is that GCC's implementation of C++ name lookup rules changed between 4.6 and 4.7. In 4.6 and earlier, GCC was more permissive and allowed some non-standard lookups, and in 4.7 it implemented the standard behaviour (see http://gcc.gnu.org/gcc-4.7/changes.html). The code causing the errors is taking advantage of the non-standard lookups that were allowed in 4.6 and earlier. The fix is to prefix the offending names with 'this->', as suggested by the compiler. I realize that B2G doesn't support GCC 4.7, and that there may be other reasons for that than this, but presumably we want it to eventually support 4.7, and I see no harm in fixing this now... so I propose that we do so. I'm happy to write a patch.
The problem is that this is code in our upstream repositories that we don't have forks of right now. I wonder if this is fixed for jelly bean. I'm going to close this bug because I don't think we want to start a new fork of th[is|ese] librar[y|ies].
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.