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

RESOLVED FIXED

Status

RESOLVED FIXED
10 years ago
6 months ago

People

(Reporter: dmandelin, Unassigned)

Tracking

Trunk
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
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.
(Reporter)

Updated

10 years ago
Blocks: 431832
(Reporter)

Comment 1

10 years ago
Created attachment 320305 [details] [diff] [review]
Proposed patch to add to Dehydra GCC patch queue

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.
(Reporter)

Updated

10 years ago
Attachment #320305 - Flags: review?(tglek)

Comment 2

10 years ago
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+
(Reporter)

Comment 3

10 years ago
Pushed.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

10 years ago
Depends on: 438062

Updated

6 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.