Closed Bug 1643528 Opened 1 year ago Closed 1 year ago

Cannot compile code with nss headers and -Werror=strict-prototypes

Categories

(NSS :: Libraries, defect, P1)

3.53

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rrelyea, Assigned: rrelyea)

Details

Attachments

(1 file)

Description of problem:
The latest upgrade of nss broke compilation with -Werror=strict-prototypes

Version-Release number of selected component (if applicable):

How reproducible:
Deterministic

Steps to Reproduce:

  1. dnf install -y gcc nss-devel
  2. cat >test.c <<EOF
    #include <nss.h>
    #include <sechash.h>
    #include <pk11func.h>
    EOF
  3. gcc pkg-config --cflags nss -c -Wstrict-prototypes -Werror=strict-prototypes test.c

Actual results:
sh-5.0$ gcc pkg-config --cflags nss -c -Wstrict-prototypes -Werror=strict-prototypes test.c
In file included from /usr/include/nss3/pk11func.h:12,
from test.c:3:
/usr/include/nss3/pk11pub.h:951:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
951 | int SECMOD_GetSystemFIPSEnabled();
| ^~~
cc1: some warnings being treated as errors
sh-5.0$ echo $?
1

Expected results:
sh-5.0$ gcc pkg-config --cflags nss -c -Wstrict-prototypes -Werror=strict-prototypes test.c
sh-5.0$ echo $?
0

Additional info:
Looks like it was newly added function.
sh-5.0$ grep -RniI SECMOD_GetSystemFIPSEnabled /usr/include/
sh-5.0$ rpm -q nss-devel
nss-devel-3.52.0-2.fc33.x86_64

And simple workaround is to run following command as root

sed -e '/SECMOD_GetSystemFIPSEnabled/s/();/(void);/' -i /usr/include/nss3/pk11pub.h

Assignee: nobody → rrelyea
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P1
Comment on attachment 9154405 [details] [diff] [review]
nss-3.53-strict-proto-fix.patch

Forgot to put a reviewer up. It's a simple enough patch, but if you want me to go through the phabricator overhead I will.
bob
Attachment #9154405 - Flags: review?(kjacobs.bugzilla)
Comment on attachment 9154405 [details] [diff] [review]
nss-3.53-strict-proto-fix.patch

LGTM, thanks.
Attachment #9154405 - Flags: review?(kjacobs.bugzilla) → review+
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 3.55
You need to log in before you can comment on or make changes to this bug.