Closed Bug 433084 Opened 16 years ago Closed 16 years ago

Dehydra/Treehydra/GCC: parameter attributes overridden by function definitions.

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dmandelin, Unassigned)

References

Details

Attachments

(1 file)

From bug 420933 comment 3:

  It appears that parameter annotations in function definitions
  override those in function declarations. I.e., given:

    PRBool Get(..., nsIFoo **aFoo NS_OUTPARAM);

    PRBool Get(..., nsIFoo **aFoo) {
      // code
    }

  At the call site for Get, there will be no attribute.

I have confirmed that GCC does this by reading the source. The key line of code is in cp/decl.c near line 2000:

  DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl)

This code is executed when a definition occurs after a declaration, and it overwrites the argument list entirely, thus clobbering all attributes from the declaration.
Blocks: 431832
This does what we need, and allows the analysis to work as needed in bug 431832, and passes all our test cases and builds FF.

We will need to check on this for Mac eventually.
Attachment #320305 - Flags: review?(tglek)
Comment on attachment 320305 [details] [diff] [review]
Proposed patch to add to Dehydra GCC patch queue

Nice and concise, go ahead and add this to the patch queue, i'd put this patch after plugin.diff
Attachment #320305 - Flags: review?(tglek) → review+
Pushed.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Depends on: 438062
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: