Closed Bug 442968 Opened 16 years ago Closed 16 years ago

Format outparams messages in the standard way

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.1a1

People

(Reporter: benjamin, Assigned: benjamin)

Details

Attachments

(2 files, 1 obsolete file)

The current outparams warnings are multiline and those lines are indented. This makes it easier to read in some cases, but tools such as compile-mode don't linkify the message correctly. This patch uses the standard GCC formatting so that locations are parsed correctly. It also gets rid of the bogus location reported at the beginning of the warning message.
Attachment #327622 - Flags: review?(dmandelin)
Oh, the resulting output looks like this:

../../../../src/xpcom/proxy/tests/proxy-create-threadsafety.cpp: In member function ‘virtual nsresult ProxyTest::Test(PRInt32, PRInt32, PRInt32*)’:
../../../../src/xpcom/proxy/tests/proxy-create-threadsafety.cpp:147: warning: outparam '_retval' not written on NS_SUCCEEDED(return value)
../../../../src/xpcom/proxy/tests/proxy-create-threadsafety.cpp:121:   outparam declared here
And the commented-out code was an attempt to get the location of the un-annotated function call. It isn't working because the ss.getBlame(v) isn't a call expression, it's a GIMPLE_MODIFY_STMT. I'm guessing the CALL_EXPR was nested in the gimple statement, but I didn't follow up.
Attachment #327622 - Flags: review?(dmandelin) → review+
(In reply to comment #2)
> And the commented-out code was an attempt to get the location of the
> un-annotated function call. It isn't working because the ss.getBlame(v) isn't a
> call expression, it's a GIMPLE_MODIFY_STMT. I'm guessing the CALL_EXPR was
> nested in the gimple statement, but I didn't follow up.

If 'isn' is a GIMPLE_MODIFY_STMT that contains a call, then isn.operands()[1] is a CALL_EXPR. I assume you're trying to get the location of the decl from that then?

This adds maybewritten declaration goodness.
Attachment #327622 - Attachment is obsolete: true
Attachment #327632 - Flags: review?(dmandelin)
Attachment #327632 - Flags: review?(dmandelin) → review+
Pushed, revision ad4228bbd961
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1a1
The original patch broke the test case e13.cpp, because that method returns void, so this.retvar is void, so ss.getBlame(this.retvar) fails. Here is a fix. The error message is still a little funny because it returns to NS_SUCCEEDED(return value) instead of noting that the return value is void, so the method is assumed to always succeed.
Attachment #327706 - Flags: review?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #327706 - Flags: review? → review?(benjamin)
Attachment #327706 - Flags: review?(benjamin) → review+
Pushed.
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
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: