Closed
Bug 431677
Opened 17 years ago
Closed 17 years ago
outparam errors in netwerk/cookie
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: benjamin, Assigned: benjamin)
References
Details
Attachments
(1 file)
1.47 KB,
patch
|
dmandelin
:
review+
|
Details | Diff | Splinter Review |
Now that we have the outparam analysis turned on, I'm working my way through the errors in -Werror code. I found a bug in the analysis scripts and also, I think, a bug.
With the patch I am attaching, I believe this code should pass, but it's still failing:
../../../../src/netwerk/cookie/src/nsCookieService.cpp: In member function ‘virtual nsresult nsCookieService::GetEnumerator(nsISimpleEnumerator**)’:
../../../../src/netwerk/cookie/src/nsCookieService.cpp:2272: error: outparam not written on NS_SUCCEEDED(return value): aEnumerator
Outparam declared at: ../../../../src/netwerk/cookie/src/nsCookieService.cpp:814:65
Return at: ../../../../src/netwerk/cookie/src/nsCookieService.cpp:821:55
Possibly written by unannotated outparam in call at: ../../../../src/netwerk/cookie/src/nsCookieService.cpp:821:55
NS_IMETHODIMP
nsCookieService::GetEnumerator(nsISimpleEnumerator **aEnumerator)
{
nsCOMArray<nsICookie> cookieList(mCookieCount);
nsGetEnumeratorData data(&cookieList, PR_Now() / PR_USEC_PER_SEC);
mHostTable.EnumerateEntries(COMArrayCallback, &data);
return NS_NewArrayEnumerator(aEnumerator, cookieList);
}
Is it possible that, because aEnumerator is not at the end of the argument list, it's not being treated as an outparam?
Attachment #318800 -
Flags: review?(dmandelin)
Updated•17 years ago
|
Attachment #318800 -
Flags: review?(dmandelin) → review+
Comment 1•17 years ago
|
||
I'm slightly appalled that I missed changing the script attribute names when I changed them in ncore.h.
Anyway, the remaining problem is that 'configure.in' refers to 'NS_STATIC_CHECKING' while the source code uses 'STATIC_CHECKING'. To confirm, I took out the 'NS_' from mozilla-config.h in the build dir, and the file compiled without any outparams errors. Which name do you want?
Assignee | ||
Comment 2•17 years ago
|
||
Pushed fixes, including renaming to NS_STATIC_CHECKING. Revision f337857f6837
Assignee: nobody → benjamin
Assignee | ||
Updated•17 years ago
|
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•