Closed Bug 305752 Opened 19 years ago Closed 19 years ago

compilation problem with NSSOID type on Solaris 2.8 using gcc 4.0.1

Categories

(NSS :: Libraries, defect)

Other
Other
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 284386

People

(Reporter: luc, Assigned: wtc)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.9) Gecko/20050711 Firefox/1.0.5
Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.10) Gecko/20050824 Firefox/1.0.6 

When I compile firefox from source on a sparc running Solaris 2.8 and using gcc
4.0.1, I get an error on an array having an incomplete type in file
mozilla/security/nss/lib/pki1/oiddata.h. The incomplete type is NSSOID, which is
completely defined elsewhere but is only defined by a forward declaration in the
headers included here.

It looks to me as if gcc 4.0.1 were more picky about types. I'm not sure here if
it is right or not, but it seems to consider that when NSSOID is an incomplete
type, then the two declarations "NSSOID nss_builtin_oids[];" and "NSSOID
*nss_builtin_oids;" are not equivalent.


Reproducible: Always

Steps to Reproduce:
1. install gcc 4.0.1 on a sparc/Solarix box
2. try to compile
3. wait for the compiler error

Actual Results:  
compiler error, stopping the installation process

Expected Results:  
compiled everything

Here is a trivial patch that corrected the problem for me :

--- mozilla/security/nss/lib/pki1/oiddata.h.orig	2002-01-04 06:22:07.000000000 +0100
+++ mozilla/security/nss/lib/pki1/oiddata.h	2005-08-24 15:12:08.181812376 +0200
@@ -43,7 +43,7 @@
 #include "nsspki1t.h"
 #endif /* NSSPKI1T_H */
 
-extern const NSSOID nss_builtin_oids[];
+extern const NSSOID *nss_builtin_oids;
 extern const PRUint32 nss_builtin_oid_count;
 
 /*extern const nssAttributeTypeAliasTable nss_attribute_type_aliases[];*/
the same problem occurs with thunderbird 1.0.6
error text:
  oiddata.h:46: array type has incomplete element type.

the patch works for gnu-linux(Debian gcc 4.0.1-2) + Mozilla-1.7.11-suite
-> NSS :: Libraries for advisement
Assignee: nobody → wtchang
Component: Build Config → Libraries
Product: Firefox → NSS
QA Contact: build.config → jason.m.reid
Thanks for the bug report and the patch.  This bug
has been fixed in Firefox 1.5.  We are still trying
to get the fix into the Firefox 1.0.x branch.

*** This bug has been marked as a duplicate of 284386 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.