Issue Details (XML | Word | Printable)

Key: PCC-476
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Volkmar Klatt
Votes: 0
Watchers: 0
Operations

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

issue with unsigned bitfields

Created: 18/Aug/14 07:31 PM   Updated: 21/Aug/14 09:19 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File tr_20140818_87.c (0.5 kB)

Environment:
pcc 1.1.0.DEVEL 20140818 for i686-pc-linux-gnu


 Description  « Hide
/* tr_20140818_87.c - test file for pcc - Volkmar Klatt
   issue with unsigned bitfields

   pcc 1.1.0.DEVEL 20140818 for i686-pc-linux-gnu

   usage:
   gcc tr_20140818_87.c -o z
   pcc tr_20140818_87.c -o zz
   ./z # a
   ./zz # b */
#include <stdio.h>

struct S {
   unsigned f : 22;
};

int main(void)
{
   struct S s = {1};

   if ((s.f = 1) > -1) /* always true */
      printf("a\n");
   else
      printf("b\n");

   return 0;
}




 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 19/Aug/14 06:27 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 19/Aug/14 06:28 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]