Issue Details (XML | Word | Printable)

Key: PCC-405
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

gcc extension ?: does not handle pointer type correctly

Created: 01/Sep/12 09:35 AM   Updated: 01/Sep/12 10:20 AM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386


 Description  « Hide
the gcc extension ?: does not handle a pointer type correctly, as shown by the following code fragment

int foo (int a)
{
    return a ?: -1;
}

void *bar (void *a)
{
    return a ?: (void *)0L;
}

the first (foo) is handled ok, but the second (bar) produces spurious warnings:

test.c, line 8: warning: illegal combination of pointer and integer
test.c, line 8: warning: illegal combination of pointer and integer

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 01/Sep/12 10:20 AM
Fixed. Evaluation needed to be a little bit later so that types were correct.