Closed Bug 431677 Opened 17 years ago Closed 17 years ago

outparam errors in netwerk/cookie

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: benjamin)

References

Details

Attachments

(1 file)

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)
Attachment #318800 - Flags: review?(dmandelin) → review+
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?
Pushed fixes, including renaming to NS_STATIC_CHECKING. Revision f337857f6837
Assignee: nobody → benjamin
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Blocks: 420933
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: