no matching function for call to 'ArrayLength(const nsGSettingsService::Init()::nsGSettingsDynamicFunction [14])'

RESOLVED FIXED in mozilla10

Status

()

Toolkit
General
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: karlt, Assigned: Waldo)

Tracking

Trunk
mozilla10
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
/home/karl/moz/dev/toolkit/system/gnome/nsGSettingsService.cpp: In member function 'nsresult nsGSettingsService::Init()':
/home/karl/moz/dev/toolkit/system/gnome/nsGSettingsService.cpp:289:57: error: no matching function for call to 'ArrayLength(const nsGSettingsService::Init()::nsGSettingsDynamicFunction [14])'

http://hg.mozilla.org/mozilla-central/annotate/cf5da681d577/toolkit/system/gnome/nsGSettingsService.cpp#l289
--enable-gio
g++ (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) 4.5.3
(Assignee)

Comment 1

7 years ago
I have a blog post coming shortly talking about mozilla::ArrayLength's limitations (one of which you've run into here) (and not so much its limitations as C++98's limitations), which will explain how to address various failure modes, including this one, in detail.

Until then, suffice it to say you can fix this problem by moving the definition of |struct nsGSettingsDynamicFunction| outside the function.  The relevant array can still be inside the function, just the type of its elements can't be.  I'll push this fix in the morning if no one else has yet.

(Why hasn't any tinderbox compiler complained about this?  I saw many, many instances of this problem when building locally with Linux gcc 4.6.1, and when tryservering to make sure it worked on other platforms, and I fixed all of them.  Does this one failure hide other, similar failures too?)
(Reporter)

Comment 2

7 years ago
(In reply to Jeff Walden (remove +bmo to email) from comment #1)
> (Why hasn't any tinderbox compiler complained about this?

This is only built with --enable-gio, which is not the default (partly because of the age of the build systems).
(Assignee)

Comment 3

7 years ago
Ah.

I went ahead and wrote up a fix (trivial enough that it didn't seem necessary to get a review) that I just landed in m-i (after verifying a --enable-gio build compiled fine):

https://hg.mozilla.org/integration/mozilla-inbound/rev/7056c3146a24
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Version: 5 Branch → Trunk
https://hg.mozilla.org/mozilla-central/rev/7056c3146a24
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.