Closed
Bug 331299
Opened 19 years ago
Closed 13 years ago
op_noacc.c: In function `main': 94: warning: control reaches end of non-void function
Categories
(NSPR :: NSPR, defect, P2)
NSPR
NSPR
Tracking
(Not tracked)
RESOLVED
FIXED
4.9.1
People
(Reporter: timeless, Assigned: atulagrwl)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [build_warning])
Attachments
(1 file, 3 obsolete files)
|
1.17 KB,
patch
|
Details | Diff | Splinter Review |
/Users/timeless/mozilla/nsprpub/pr/tests/op_noacc.c: In function `main':
/Users/timeless/mozilla/nsprpub/pr/tests/op_noacc.c:94: warning: control reaches end of non-void function
Attachment #215857 -
Flags: review?(wtchang)
Attachment #215857 -
Attachment description: ifdef the rest of the file → oops. wrong bug
Attachment #215857 -
Attachment is obsolete: true
Attachment #215857 -
Flags: review?(wtchang)
Attachment #215858 -
Flags: review?(wtchang)
Updated•19 years ago
|
QA Contact: wtchang → nspr
Updated•14 years ago
|
Blocks: buildwarning
Whiteboard: [build_warning]
| Assignee | ||
Comment 3•14 years ago
|
||
Current warnings:
/mozilla/mozilla-central/nsprpub/pr/tests/op_noacc.c: In function ‘main’:
/mozilla/mozilla-central/nsprpub/pr/tests/op_noacc.c:72:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
/mozilla/mozilla-central/nsprpub/pr/tests/op_noacc.c:82:1: warning: control reaches end of non-void function [-Wreturn-type]
| Assignee | ||
Comment 4•14 years ago
|
||
Assignee: wtc → atulagrwl
Attachment #215858 -
Attachment is obsolete: true
Attachment #583861 -
Flags: review?(benjamin)
Attachment #215858 -
Flags: review?(wtc)
Comment 5•14 years ago
|
||
Comment on attachment 583861 [details] [diff] [review]
Patch v1
I am not an NSPR peer.
Attachment #583861 -
Flags: review?(benjamin) → review?(wtc)
Comment 6•14 years ago
|
||
Comment on attachment 583861 [details] [diff] [review]
Patch v1
r=wtc. Thanks for the patch.
>+ if (err01 == NULL) {
>+ if (PR_GetError() == PR_NO_ACCESS_RIGHTS_ERROR) {
>+ printf ("error code is %d\n",PR_GetError());
>+ printf ("PASS\n");
>+ return 0;
>+ }
>+ }
In this form, the nested if statements can be merged with &&:
if (err01 == NULL && PR_GetError() == PR_NO_ACCESS_RIGHTS_ERROR) {
printf ("error code is %d\n",PR_GetError());
printf ("PASS\n");
return 0;
}
We can also attempt more cleanup. For example, it may
make sense to print the error code whenever PR_Open fails.
In that form, we would need the nested if statements:
if (err01 == NULL) {
int error = PR_GetError();
printf ("error code is %d\n", error);
if (error == PR_NO_ACCESS_RIGHTS_ERROR) {
printf ("PASS\n");
return 0;
}
}
Attachment #583861 -
Flags: review?(wtc) → review+
| Assignee | ||
Comment 7•14 years ago
|
||
Agreeing to all the changes suggested.
Attachment #583861 -
Attachment is obsolete: true
| Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 8•13 years ago
|
||
Sorry this patch sat around so long, I checked it into NSPR CVS for you:
Checking in pr/tests/op_noacc.c;
/cvsroot/mozilla/nsprpub/pr/tests/op_noacc.c,v <-- op_noacc.c
new revision: 3.10; previous revision: 3.9
done
Status: NEW → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
OS: Mac OS X → All
Hardware: PowerPC → All
Resolution: --- → FIXED
Version: other → 4.9.1
| Assignee | ||
Comment 9•13 years ago
|
||
Thanks a lot Ted.
Updated•13 years ago
|
Priority: -- → P2
Target Milestone: --- → 4.9.1
Version: 4.9.1 → other
You need to log in
before you can comment on or make changes to this bug.
Description
•