PR_STATIC_ASSERT causes NSS build failures on GCC 11
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
People
(Reporter: bdk, Unassigned)
References
Details
Attachments
(1 file)
14.56 KB,
text/plain
|
Details |
I'm having issues building NSS using GCC 11 using the instructions from this page: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Building
I don't think GCC 11 has been officially released, but it should be soon. It looks to me that the issue is the new -Warray-parameter warning. I'm attaching the output of ./nss/build.sh.
I'm running Fedora 34 beta.
Comment 1•2 years ago
|
||
This is something that NSPR can fix. We can test for the presence of _Static_assert
, which is in most versions of GCC that we need to support (it was added in 4.6; NSS uses 4.4 though). It's c11, which we can't outright require, but it should be easy to detect and compile in.
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
nss-3.66 is building for me with GCC 11. I think this one could be closed, but there seems to be one last cleanup: delete the #define in nspr/pr/include/prtypes.h
Comment 3•2 years ago
|
||
It sounds like GCC changed, because I still see this:
#define PR_STATIC_ASSERT(condition) \
extern void pr_static_assert(int arg[(condition) ? 1 : -1])
Are you suggesting we remove that Ben?
Reporter | ||
Comment 4•2 years ago
|
||
That's there, but it's just a #define. For older versions of NSS I saw a lot of uses of that define. It seems like someone replaced those with something else and the last step is to remove the #define.
Comment 5•2 years ago
|
||
Two things:
https://searchfox.org/nss/search?q=PR_STATIC_ASSERT&path= indicates that this has lots of use (which is why I suspect that GCC changed).
And we can't remove things from the NSPR API without affecting backward compatibility. We would need to replace it.
Reporter | ||
Comment 6•2 years ago
|
||
Sorry, rg was confusing me, you're right about it still being used. I think you're also right about the GCC change, since I was getting a build error before and now it's working.
Comment 7•2 years ago
|
||
Also note we now have a CI job that builds Firefox with GCC 11, and it doesn't hit this problem.
Reporter | ||
Comment 8•1 year ago
|
||
I think this one can be safely closed now. Building is working and that cleanup step that I suggested doesn't make sense.
Description
•