Bug 1843417 - Cannot compile code with nss headers and -Werror=strict-prototypes
Summary: Cannot compile code with nss headers and -Werror=strict-prototypes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nss
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bob Relyea
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-03 09:33 UTC by Lukas Slebodnik
Modified: 2020-06-29 01:05 UTC (History)
6 users (show)

Fixed In Version: nss-3.53.0-2.fc32 nss-3.53.0-2.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-16 01:30:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lukas Slebodnik 2020-06-03 09:33:25 UTC
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

Comment 1 Fedora Update System 2020-06-10 22:50:47 UTC
FEDORA-2020-fc6d6ec06f has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-fc6d6ec06f

Comment 2 Fedora Update System 2020-06-10 22:51:38 UTC
FEDORA-2020-b677736a37 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b677736a37

Comment 3 Fedora Update System 2020-06-14 17:16:16 UTC
nss-3.53.0-2.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b677736a37

Comment 4 Fedora Update System 2020-06-14 18:01:50 UTC
nss-3.53.0-2.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-fc6d6ec06f

Comment 5 Fedora Update System 2020-06-16 01:30:16 UTC
nss-3.53.0-2.fc32 has been pushed to the Fedora 32 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2020-06-29 01:05:30 UTC
FEDORA-2020-b677736a37 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


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