Open Bug 1703255 Opened 4 years ago

NSPR 4.30 won't compile with gcc-11

Categories

(NSPR :: NSPR, defect)

4.30
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: jthackray, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15

Steps to reproduce:

Tried to compile NSPR 4.30 with gcc-11 using the nss-3.63-with-nspr-4.30.tar.gz package

Actual results:

Failed to compile:

In file included from ../../../dist/Linux5.8_x86_64_gcc_glibc_PTH_64_OPT.OBJ/include/prerror.h:9,
from drbg.c:9:
drbg.c: In function ‘RNG_RandomUpdate’:
../../../dist/Linux5.8_x86_64_gcc_glibc_PTH_64_OPT.OBJ/include/prtypes.h:556:38: error: argument 1 of type ‘int[1]’ with mismatched bound [-Werror=array-parameter=]
556 | extern void pr_static_assert(int arg[(condition) ? 1 : -1])
| ^
drbg.c:577:5: note: in expansion of macro ‘PR_STATIC_ASSERT’
577 | PR_STATIC_ASSERT(((size_t)-1) > (size_t)1);
| ^~~~~~~~~~~~~~~~
../../../dist/Linux5.8_x86_64_gcc_glibc_PTH_64_OPT.OBJ/include/prtypes.h:556:38: note: previously declared as ‘int *’
556 | extern void pr_static_assert(int arg[(condition) ? 1 : -1])
| ^
drbg.c:475:9: note: in expansion of macro ‘PR_STATIC_ASSERT’
475 | PR_STATIC_ASSERT(sizeof(bytes) >= SHA256_LENGTH);
| ^~~~~~~~~~~~~~~~
drbg.c: In function ‘PRNGTEST_RunHealthTests’:
../../../dist/Linux5.8_x86_64_gcc_glibc_PTH_64_OPT.OBJ/include/prtypes.h:556:38: error: argument 1 of type ‘int[1]’ with mismatched bound [-Werror=array-parameter=]
556 | extern void pr_static_assert(int arg[(condition) ? 1 : -1])
| ^
drbg.c:915:5: note: in expansion of macro ‘PR_STATIC_ASSERT’
915 | PR_STATIC_ASSERT(sizeof(rng_known_result) >= sizeof(rng_reseed_result));
| ^~~~~~~~~~~~~~~~
../../../dist/Linux5.8_x86_64_gcc_glibc_PTH_64_OPT.OBJ/include/prtypes.h:556:38: note: previously declared as ‘int *’
556 | extern void pr_static_assert(int arg[(condition) ? 1 : -1])
| ^
drbg.c:475:9: note: in expansion of macro ‘PR_STATIC_ASSERT’
475 | PR_STATIC_ASSERT(sizeof(bytes) >= SHA256_LENGTH);
| ^~~~~~~~~~~~~~~~

Expected results:

Compiled successfully.

You need to log in before you can comment on or make changes to this bug.