Last Comment Bug 448431 - PK11_CreateMergeLog() declaration causes gcc warning when compiling with -Wstrict-prototypes
: PK11_CreateMergeLog() declaration causes gcc warning when compiling with -Wst...
Status: RESOLVED FIXED
:
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: 3.12
: All All
: P4 trivial (vote)
: 3.12.2
Assigned To: nobody
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-29 13:26 PDT by Dave Allan
Modified: 2008-08-26 22:11 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
trivial test program showing warning (50 bytes, text/plain)
2008-07-29 13:28 PDT, Dave Allan
no flags Details
add void to declaration and definition (1.11 KB, patch)
2008-07-29 13:30 PDT, Dave Allan
wtc: review+
Details | Diff | Splinter Review

Description Dave Allan 2008-07-29 13:26:36 PDT
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
Comment 1 Dave Allan 2008-07-29 13:28:16 PDT
Created attachment 331644 [details]
trivial test program showing warning
Comment 2 Dave Allan 2008-07-29 13:30:18 PDT
Created attachment 331645 [details] [diff] [review]
add void to declaration and definition
Comment 3 Wan-Teh Chang 2008-08-26 22:04:48 PDT
Comment on attachment 331645 [details] [diff] [review]
add void to declaration and definition

r=wtc.
Comment 4 Wan-Teh Chang 2008-08-26 22:11:08 PDT
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

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