<< Back to previous view

[PCC-405] gcc extension ?: does not handle pointer type correctly Created: 01/Sep/12  Updated: 01/Sep/12

Status: Resolved
Project: pcc
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: NetBSD/i386


 Description   
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

 Comments   
Comment by Anders Magnusson [ 01/Sep/12 10:20 AM ]
Fixed. Evaluation needed to be a little bit later so that types were correct.
Generated at Fri Oct 31 13:11:46 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.