Issue Details (XML | Word | Printable)

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

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

-Wshadow behaves differently with ansi and non-ansi function argument declarations

Created: 06/Apr/10 11:50 AM   Updated: 03/Jun/10 09:51 PM
Component/s: pcc backend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD


 Description  « Hide
When using -Wshadow, pcc notes an error with a non-ansi style function argument declaration that is not an error with ansi style declaration. The following code demonstrates it

int
foo(int arg, int (*func)(int arg))
{
}

int
bar(arg, func)
    int arg;
    int (*func)(int arg);
{
}

only the second instance causes a complaint when built with -Wshadow

This is perhaps not something that will be come across often and is easily fixed by using ansi style declarations or removing the unnecessary label but thought I should note it :)


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 03/Jun/10 09:51 PM
At least the example code won't complain anymore :-)