Other HI-TECH Compilers & Products >> Other HI-TECH Compilers & Products

Pages: 1
NicolasReboul
stranger


Reged: Oct 18 2007
Posts: 1
Error (741) : bitfield too large
      #30175 - Thu Oct 18 2007 10:53 AM

Hello

I use HI-TECH C COMPILER (Holtek MCU) V9.10PL6 to compile a firmware.

I have a problem with the compilation of this kind of structure (copy from the manual (HI-TECH C for HOLTEK MCU p35))
Code:

struct {
unsigned lo : 1;
unsigned dummy : 14;
unsigned hi : 1;
} foo;




Error(741) W:\xxx...xxx.h 164: bitfield too large (14 bits)
Error(741) W:\xxx...xxx.h 164: bitfield too large (14 bits)
Error(741) W:\xxx...xxx.h 164: bitfield too large (14 bits)


if I change the struct to
Code:

struct {
unsigned lo : 1;
unsigned dummy : 8;
unsigned hi : 1;
} foo;



the compilation is completed successfully

Do you have a solution to solve the problem with a 14 bits field

regards


Post Extras: Print Post   Remind Me!   Notify Moderator  
jtemplesModerator
Guru
****

Reged: Oct 16 2003
Posts: 1604
Loc: Southern California
Re: Error (741) : bitfield too large [Re: NicolasReboul]
      #30188 - Thu Oct 18 2007 07:54 PM

I haven't used the Holtek compiler, but compilers for 8-bit targets don't appear to be required to permit an individual bit-field to be more than 8 bits.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Mark Pappin

***

Reged: Nov 01 2004
Posts: 599
Loc: Brisbane, Australia
Re: Error (741) : bitfield too large [Re: jtemples]
      #30214 - Fri Oct 19 2007 04:33 PM

Quote:

compilers for 8-bit targets don't appear to be required to permit an individual bit-field to be more than 8 bits.


From reading through the Standard just now I think it does require that bit-fields up to at least the width of int be supported.
Regardless, our compilers for 8-bit targets don't allow individual bit-fields wider than 8 bits.
Maybe in a future version they will - the PRO compilers have some internal features that suggest this will be fairly easy to implement across the range.

--------------------
Mark Pappin - HI-TECH Software


Post Extras: Print Post   Remind Me!   Notify Moderator  
Bennyboos
Tester


Reged: Mar 16 2006
Posts: 23
Loc: Chester, UK
Re: Error (741) : bitfield too large [Re: Mark Pappin]
      #86862 - Tue Nov 25 2008 09:16 AM

This post is over a year old now.
Out of interest, does the latest version of PICC18-Pro (and DSPICC come to that) now permit bit-fields that are wider than 8 bits?

Ben


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 4 anonymous users are browsing this forum.

Moderator:  jtemples, Dan Henry, Andrew L, mikerj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 4225

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5