bugTiny C Compiler - Bugs: bug #11351, Fails with bitfields in structure...

 
 

bug #11351: Fails with bitfields in structure with typedef

Submitted by:  None
Submitted on:  Sun 19 Dec 2004 09:25:04 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 19 Oct 2012 01:47:26 PM UTC, comment #2:

Trying to compile your testcase, with a simple

int main(void){return 0;} added to make a program, compiles successfully with current tcc. Hence closing this bug.

Thanks for the report.

Thomas Preud'homme <robotux>
Project Member
Mon 27 Dec 2004 05:49:16 AM UTC, comment #1:

Test case:

// REQ: Need constant definitions

#define TRUE 1
#define FALSE 0
#define VOID void

// REQ: Define system data sizes.

typedef unsigned char U8,*U8_P;
typedef unsigned short U16,*U16_P;
typedef unsigned int U32,*U32_P;
typedef unsigned long long U64,*U64_P;
typedef VOID *VPTR;
typedef U32 PTR_INT;

#define NULLP (VPTR)0

typedef VPTR TYPE,*TYPE_P;
typedef U32 SIZE,*SIZE_P;
typedef U32 REFCNT,*REFCNT_P;
typedef VPTR TAG,*TAG_P;
typedef U16 FLAG,*FLAG_P;
typedef U16 BIT,*BIT_P;
typedef VPTR ID,*ID_P;

typedef union OBJFLAG_T {
struct {
FLAG Size:1;
FLAG RefCnt:1;
FLAG Tag:1;
} bit;
FLAG all;
} OBJFLAG, *OBJFLAG_P;

typedef union TYPEFLAG_T {
struct {
FLAG Hash:1;
FLAG ID:1;
} bit;
FLAG all;
} TYPEFLAG, *TYPEFLAG_P;

Anonymous
Sun 19 Dec 2004 09:25:04 PM UTC, original submission:

when using typedefs such as

typdef unsigned int FLAG;

in structures such as:

struct X {
FLAG f1:1;
FLAG f2:1;
}

Sometimes an error message is thrown:
'bitfields must have scalar type'

Debugging shows code in struct_decl show incorrect type for
type1.t variable.
ie type is shown as PTR not unsigned int.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by robotux (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 19 Oct 2012 01:47:26 PM UTCrobotuxStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1