Issue Details (XML | Word | Printable)

Key: PCC-468
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.

_Bool is not promoted during bitshift operation

Created: 13/Aug/14 09:41 PM   Updated: 13/Aug/14 10:19 PM
Component/s: C frontend, i386 target
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
a _Bool argument is not integer promoted during a bitshift operation. Consider the following code

unsigned int foo(_Bool a)
        return a << 10;

when compiled with pcc, produces
test.c, line 3: warning: shift larger than type
test.c, line 3: warning: shift larger than type

I think, according to 6.5.7 note 3 that the "a" should experience integer promotion before the bitshift takes place..?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 13/Aug/14 10:19 PM
Now LS/RS arguments are promoted.