Closed Bug 226241 Opened 21 years ago Closed 20 years ago

Anonymous unions may only contain non-static data members and not define types.

Categories

(Core :: Networking, enhancement)

HP
HP-UX
enhancement
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.7final

People

(Reporter: timeless, Assigned: darin.moz)

References

()

Details

(Keywords: fixed1.7)

Attachments

(2 files, 3 obsolete files)

http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTest/1069228920.3452.gz
Error (future) 254: "nsProtocolProxyService.h", line 122 # Anonymous unions may 
only contain non-static data members and not define types.
                struct {
                ^^^^^^
Error (future) 254: "nsProtocolProxyService.h", line 127 # Anonymous unions may 
only contain non-static data members and not define types.
                struct {
                ^^^^^^
Status: UNCONFIRMED → NEW
Ever confirmed: true
bryner: you were working on a patch for this right?
Target Milestone: --- → mozilla1.7final
Attached patch v1 patch (obsolete) — Splinter Review
perhaps this will solve the HP-UX build problem.
Attachment #146216 - Flags: superreview?(bryner)
Attachment #146216 - Flags: review?(timeless)
Attachment #146216 - Flags: superreview?(bryner) → superreview+
Attachment #146216 - Flags: review?(timeless) → review+
fixed-on-trunk
Status: NEW → ASSIGNED
Attachment #146216 - Flags: approval1.7?
Trying to compile Mozilla from CVS on Sparc Solaris, I get the following errors.
I suspect that is caused by the checkin for this bug, but I'm not sure.

"nsProtocolProxyService.h", line 133: Error: nsProtocolProxyService::HostInfoIP
is not accessible from nsProtocolProxyService::HostInfo::union.
"nsProtocolProxyService.h", line 134: Error:
nsProtocolProxyService::HostInfoName is not accessible from
nsProtocolProxyService::HostInfo::union.
doh, because they are defined in the private section of the class.  wonderful! 
patch coming up.
Comment on attachment 146216 [details] [diff] [review]
v1 patch

a-, Darin's working on a patch that will keep Solaris happy
Attachment #146216 - Flags: approval1.7? → approval1.7-
Attached patch solaris bustage fix (obsolete) — Splinter Review
Jens: can you confirm that this patch fixes the problem?  thanks!
Confirming. Thanx!
Comment on attachment 146311 [details] [diff] [review]
solaris bustage fix

Was the pack checked-in yet ?
Comment on attachment 146311 [details] [diff] [review]
solaris bustage fix

r+sr=bzbarsky.	Sigh....
Attachment #146311 - Flags: superreview+
Attachment #146311 - Flags: review+
Comment on attachment 146311 [details] [diff] [review]
solaris bustage fix

This would be better solved by doing the standard trick for portably declaring
nested clases:

struct foo;
friend struct foo;
struct foo {
  //...
};

which works around the fact that some compilers implement older versions of the
C++ standard's rules on access and nested classes
Attachment #146311 - Flags: review+ → review-
Comment on attachment 146439 [details] [diff] [review]
this should fix the Solaris bustage

No, it doesn't. The error message is:
""nsProtocolProxyService.h", line 135: Error:
nsProtocolProxyService::HostInfoIP is not accessible from
nsProtocolProxyService::HostInfo::union.
"nsProtocolProxyService.h", line 136: Error:
nsProtocolProxyService::HostInfoName is not accessible from
nsProtocolProxyService::HostInfo::union.
......"

I don't know how to make HostInfo::onion as a friend struct. Maybe we have to
use the previous fix.
perhaps the union needs to be broken out, named, and then marked up with the
friend decl as dbaron suggested.  or maybe i should just declare the HostInfo
struct at file scope! :-/
Does it work if you make only the two structs used in the union public?
> Does it work if you make only the two structs used in the union public?

It should.  Kyle, Jens?
(In reply to comment #16)
> Does it work if you make only the two structs used in the union public?

Yes, it works.
Attachment #146216 - Attachment is obsolete: true
Attachment #146439 - Attachment is obsolete: true
Attachment #146494 - Flags: review+
Comment on attachment 146494 [details] [diff] [review]
dbaron's suggestion in comment 16 works on deathstarii (solaris 9/forte7)

sr=darin

patch checked into trunk
Attachment #146494 - Flags: superreview+
Attached patch 1.7 branch patchSplinter Review
Attachment #146529 - Flags: approval1.7?
marking FIXED
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 146529 [details] [diff] [review]
1.7 branch patch

a=asa (on behalf of drivers) for checkin to 1.7
Attachment #146529 - Flags: approval1.7? → approval1.7+
fixed1.7
Keywords: fixed1.7
*** Bug 204811 has been marked as a duplicate of this bug. ***
V.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: