This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc, powerpc and bit field operations


Hi..
 
I am using gcc-2.95 and am having trouble with bit field operations.
 
I have no trouble defining and compiling progs, but during execution I have problems.
 
No matter how I define a bit field      
 
                                unsigned    char        : 4;
                                unsigned    short       : 4;
                                unsigned    int           : 4;
 
the compiled code always uses word length instructions  so if the fields are all contained in 16bit... a 32bit are accessed.
This usually not a problem but when mapped to hardware I get access exception because the adjacent 16bits are protected..
 
 
Is the a way to fix this or is the what "non-portable" means (among other things)
 
 
roman


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]