Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | WaE: Warning: Types cannot be declared in anonymous union. | ||||||
---|---|---|---|---|---|---|---|
Product: | Calc | Reporter: | jens-heiner.rechtien | ||||
Component: | code | Assignee: | AOO issues mailing list <issues> | ||||
Status: | CONFIRMED --- | QA Contact: | |||||
Severity: | Trivial | ||||||
Priority: | P3 | CC: | issues, stephan.bergmann.secondary | ||||
Version: | recent-trunk | ||||||
Target Milestone: | --- | ||||||
Hardware: | Unknown | ||||||
OS: | All | ||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
Description
jens-heiner.rechtien
2008-12-16 19:21:18 UTC
Created attachment 58877 [details]
potential simple fix?
Might do. However, do I understand this correctly that the problem is BOOL which is typedef sal_Bool BOOL; an using directly a POD such as unsigned char instead would not give this warning? Theoretically, using BOOL is questionable anyway and works only if the type is capable of holding at least 8 bits.. which also isn't guaranteed for unsigned char. If the problem is the typedef then also using sal_uInt8 would not do and we have to use the approach the attached patch takes. @er: the problem is not some typedef but the struct declaration inside the anonymous union (IIUC) Ah, I see, was mislead. I wonder though why that should not be allowed. @hr: sc/inc/compiler.hxx has similar union{struct{}} in ScDoubleRawToken and ScRawToken, didn't that break as well? @er: yup, same warning in sc/inc/compiler.hxx line 133 and 158. From the ISO C++ standard (ISO/IEC 14882:1998(E) -- C++ -- Classes): -- snip -- -2- A union of the form union { member-specification } ; is called an anonymous union; it defines an unnamed object of unnamed type. The member-specification of an anonymous union shall only define non-static data members. [Note: nested types and functions cannot be declared within an anonymous union. ] -- snip -- The note in the standard clarifies that an anonymous union can't have nested types. I guess it has something to do with storage classes ... Reset assigne to the default "issues@openoffice.apache.org". |