Issue Details (XML | Word | Printable)

Key: PCC-128
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

bogus warnings relating to type of function with gcc attributes

Created: 22/Apr/10 04:13 PM   Updated: 22/Apr/10 09:18 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
The following code

  struct foo {
          int a;
  } *foo;

  struct foo *bar(void) __attribute__((__unused__));

  struct foo *bar(void)
          return foo;

produces a "warning: illegal structure pointer combination" at the return statement when compiled. __unused__ is just an illustration as any attribute causes it and, the warning goes away if I remove the attributes.

I guess that the code is not comparing the correct node rather than the attribute modifying the type. Does chkpun() need to be made aware of attributes?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 22/Apr/10 09:18 PM
Correct, the struct type checking needed a slight modification. Fixed now.