PK11_CreateMergeLog() declaration causes gcc warning when compiling with -Wstrict-prototypes

RESOLVED FIXED in 3.12.2

Status

NSS
Libraries
P4
trivial
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Dave Allan, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080715 Fedora/2.0.0.16-1.fc8 Firefox/2.0.0.16
Build Identifier: CVS head

When compiling a program that includes using NSS under gcc4 (gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)) with:

gcc -Wstrict-prototypes -I /usr/include/nss3 -I /usr/include/nspr4 -o test test.c

I get the following warning:

/usr/include/nss3/pk11pub.h:249: warning: function declaration isn’t a prototype

The attached patch clears up the warning.

Reproducible: Always

Steps to Reproduce:
1. Compile the attached trivial program with gcc4 (I didn't check other versions of gcc to see if they behave differently):

gcc -Wstrict-prototypes -I /usr/include/nss3 -I /usr/include/nspr4 -o test test.c
Actual Results:  
[user@host NSS]$ gcc -Wstrict-prototypes -I /usr/include/nss3 -I /usr/include/nspr4 -o test test.c
In file included from test.c:1:
/usr/include/nss3/pk11pub.h:249: warning: function declaration isn’t a prototype
[user@host NSS]$

Expected Results:  
No warning
(Reporter)

Comment 1

9 years ago
Created attachment 331644 [details]
trivial test program showing warning
(Reporter)

Comment 2

9 years ago
Created attachment 331645 [details] [diff] [review]
add void to declaration and definition
Severity: normal → trivial
Priority: -- → P4

Updated

9 years ago
Attachment #331644 - Attachment mime type: text/x-csrc → text/plain

Comment 3

9 years ago
Comment on attachment 331645 [details] [diff] [review]
add void to declaration and definition

r=wtc.
Attachment #331645 - Flags: review+

Comment 4

9 years ago
Thanks for the patch.  I checked it in on the NSS trunk (NSS 3.12.2).

Checking in pk11merge.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11merge.c,v  <--  pk11merge.c
new revision: 1.2; previous revision: 1.1
done
Checking in pk11pub.h;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11pub.h,v  <--  pk11pub.h
new revision: 1.27; previous revision: 1.26
done
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
OS: Linux → All
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → 3.12.2
Version: unspecified → 3.12
You need to log in before you can comment on or make changes to this bug.