Issue Details (XML | Word | Printable)

Key: PCC-461
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 right-associativity of assignment expressions containing signed bitfields

Created: 03/Aug/14 01:09 AM   Updated: 05/Aug/14 11:43 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File tr_20140731_48.c (0.4 kB)

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


 Description  « Hide
/* tr_20140731_48.c - test file for pcc - Volkmar Klatt
   issue with right-associativity of
   assignment expressions containing signed bitfields
      
   pcc 1.1.0.DEVEL 20140729 for i686-pc-linux-gnu */
#include <stdio.h>

struct S {
   signed f : 25;
};

int main (void)
{
   int x;
   struct S s;
   s.f = 0;

   x = (s.f = -1);
 
   printf("%i\n", x);
   printf("%i\n", s.f);
   return 0;
}




 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 05/Aug/14 11:43 AM
Now bitfield values will be sign-extended after assignments if signed variables.