Closed Bug 224968 Opened 22 years ago Closed 22 years ago

compiling nsFontMetricsXft.cpp with Sun Forte compilers fails due to inlined function definition *after* usage

Categories

(Core Graveyard :: GFX: Gtk, defect)

Sun
SunOS
defect
Not set
blocker

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.6beta

People

(Reporter: Mitch, Assigned: dwitte)

Details

Attachments

(2 files)

User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.6a) Gecko/20031031 Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.6a) Gecko/20031031 This has been happening for a while now, but i manually edit nsFontMetricsXft.cpp to overcome the problem. I thought it's about time i should report it as a bug even though other compilers accept the syntax, it is definetly incorrect. We cannot inline a function if it is already used. Sun's Forte compilers barf and treat this as a real fatal error - since we are not getting inline(ing) as we requested and thus are left with a false sense of it actually working. Although the functions it barfs on are empty, this should be fixed, or references to them removed from the relevant classes. Refer to attachment for errors and incorrectly defined functions in lines 2109 and 2129 of mozilla/gfx/src/gtk/nsFontMetricsXft.cpp. Three solutions exist. 1. Remove the inline keyword (my current fix for a clean compile) 2. Move the two functions to nearer the top of the file so they are defined as inline before being used by other classes in the file. 3. Remove the functions (and references to the callers) altogether since they appear to be redundant as they are empty definitions. Please determine appropriate fix and checkin to cvs. Thank you. Reproducible: Always Steps to Reproduce: 1. Compile using Sun Forte CC compilers. 2. 3. Actual Results: Build failure Expected Results: Build success
Attached patch patchSplinter Review
Comment on attachment 134971 [details] [diff] [review] patch blizzard, care to r+sr this simple fix?
Attachment #134971 - Flags: superreview?(blizzard)
Attachment #134971 - Flags: review?(blizzard)
-> me
Assignee: leaf → dwitte
Status: UNCONFIRMED → NEW
Component: Build Config → GFX: Gtk
Ever confirmed: true
Any chance of getting this checked in ? It appears to compile fine on SOS8 and Forte 5.x/6.x compilers.
Try again. Any chance of having this fix integrated into the cvs tree please ? The recent changes to nsFontMetricsXft.cpp means the included patch is failing.
Comment on attachment 134971 [details] [diff] [review] patch trying a different reviewer. alecf, care to r+sr?
Attachment #134971 - Flags: superreview?(blizzard)
Attachment #134971 - Flags: superreview?(alecf)
Attachment #134971 - Flags: review?(blizzard)
Attachment #134971 - Flags: review?(alecf)
Comment on attachment 134971 [details] [diff] [review] patch pseudo-inline virtual declarations (i.e. putting the function body to a virtual function inside a class declaration) are generally bad - it makes the compiler insert a copy of the inline in every file that #include the declaration.. But I guess that's a whole other enchilada since this is a .cpp file. In any case, inline virtuals are never actually inline, because you still need a vtable entry at runtime and so the compiler will put it somewhere and still make sure it goes through the vtable to ensure that the correct method is called. My suggestion is to simply remove the 'inline' from the virtuals (As suggested above) - moving them into the class declaration buys you nothing. I suppose this patch doesn't HURT anything, you get r+sr=alecf, but I'm never a big fan of non-trivial functions being declared inside the class declaration.
Attachment #134971 - Flags: superreview?(alecf)
Attachment #134971 - Flags: superreview+
Attachment #134971 - Flags: review?(alecf)
Attachment #134971 - Flags: review+
Comment on attachment 134971 [details] [diff] [review] patch ok, thanks for the explanation... i'll keep the virtuals outside the class declaration. requesting approval for this simple compiler bustage fix.
Attachment #134971 - Flags: approval1.6b?
Comment on attachment 134971 [details] [diff] [review] patch a=tor for 1.6b checkin
Attachment #134971 - Flags: approval1.6b? → approval1.6b+
fixed.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.6beta
Thanks Dan for all the effort in comitting this back. Makes compiles much easier than hand patching.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: