Closed Bug 560582 Opened 14 years ago Closed 14 years ago

compilation errors with PR_STATIC_ASSERT when building mozilla-central with system NSPR

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: octoploid, Assigned: dbaron)

References

Details

(Keywords: regression)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
Build Identifier: 

Trunk build fails with gcc 4.5.0 on linux.

/var/tmp/yaourt-tmp-markus/aur-firefox-pgo-minefield-smp/firefox-pgo-minefield-smp/src/mozilla-central/content/svg/content/src/nsSVGElement.cpp:104:17: error: expected constructor, destructor, or type conversion before ‘(’ token
/var/tmp/yaourt-tmp-markus/aur-firefox-pgo-minefield-smp/firefox-pgo-minefield-smp/src/mozilla-central/content/svg/content/src/nsSVGElement.cpp: In member function ‘void nsSVGElement::UpdateAnimatedContentStyleRule()’:
/var/tmp/yaourt-tmp-markus/aur-firefox-pgo-minefield-smp/firefox-pgo-minefield-smp/src/mozilla-central/content/svg/content/src/nsSVGElement.cpp:1261:14: warning: unused variable ‘rv’
make[7]: *** [nsSVGElement.o] Error 1


Reproducible: Always
Component: SVG → XPCOM
QA Contact: general → xpcom
Are you building with system NSPR or something?
(In reply to comment #0)
> error: expected constructor, destructor, or type conversion before ‘(’ token

This points to this line:
  104 PR_STATIC_ASSERT(sizeof(void*) == sizeof(nsnull));

Sounds like the "PR_STATIC_ASSERT" there isn't being understood.
Octoploid: does it help if you add "#include prtypes.h" at the top of nsSVGElement.cpp?

> In member function ‘void nsSVGElement::UpdateAnimatedContentStyleRule()’:
> /var/tmp/yaourt-tmp-markus/aur-firefox-pgo-minefield-smp/firefox-pgo-minefield-smp/src/mozilla-central/content/svg/content/src/nsSVGElement.cpp:1261:14:
> warning: unused variable ‘rv’

This is ignorable (but would be nice to fix) -- it's a variable that only gets used in a NS_ABORT_IF_FALSE (i.e. debug-only).   Octoploid must be doing an opt build.
If he needs to add prtypes.h then he's almost certainly doing a system NSPR build. He'll just have to build with the in-tree nspr till a new system NSPR version is released.
Building with in-tree nspr solved the problem.
Thank you guys.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Yay, glad that worked! Correcting resolution to INVALID, since this wasn't due to a bug in Mozilla code. ("FIXED" would indicate that a patch was committed to the Mozilla codebase to fix the problem.)
Resolution: FIXED → INVALID
Blocks: 547964
Keywords: regression
So we should have configure tests for this sorts of things so that configure explains what the problem is, rather than letting people hit a build error.

It turns out we actually already *do* have a configure test for this particular feature.  This patch updates that test to reflect that we now depend on PR_STATIC_ASSERT being in prtypes.h.
Assignee: nobody → dbaron
Status: RESOLVED → REOPENED
Ever confirmed: true
Attachment #445891 - Flags: review?(ted.mielczarek)
Resolution: INVALID → ---
Status: REOPENED → ASSIGNED
Summary: gcc 4.5.0 build error svg related → compilation errors with PR_STATIC_ASSERT when building mozilla-central with system NSPR
I tested that:
 * without this patch, I can configure --with-system-nspr
 * with it, I get the error --with-system-nspr
 * with it, I can still configure with in-tree nspr
Attachment #445891 - Flags: review?(ted.mielczarek) → review+
http://hg.mozilla.org/mozilla-central/rev/ffd7972bab5f

configure will now give an error when your system NSPR isn't new enough.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Depends on: 567620
http://hg.mozilla.org/mozilla-central/file/ffd7972bab5f/configure.in#l4552

We need to actually make use of it and update it to error earlier if the correct version of nspr is not installed. I will attach the patch in just a minute.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: