I would like to know if somebody already tried to build ipmitool with the GCC
>= 4.1?
After some investigation, I probably found a bug with GCC >= 4.1 This bug has
an impact on the ipmitool. The bug seems to be related to all packed structure
in the ipmitool. The compiler seems not to pack the structure.
With the following example:
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
struct __attribute__ ((packed)) packstruct {
unsigned char t0 :5 ;
unsigned char t1 :5 ;
unsigned char t2 :5 ;
unsigned char t3 :5 ;
unsigned char t4 :4 ;
};
int
main(int argc, char ** argv)
{
printf("size: %i\n",sizeof(struct packstruct));
if(sizeof(struct packstruct) != 3)
return(1);
else
return(0);
}
//////////////////////////////////////////////////////////////////////////////
With this structure, the size of my structure is supposed to be 3 bytes, but
with a GCC >= 4.1, the size of my structure is 5 bytes.
GCC 4.1.2: Size = 5
GCC 4.3.1: Size = 5
GCC 4.0.2: Size = 3
GCC 3.3.6: Size = 3
In other hand, if I use unsigned int instead of unsigned char, the size of the
structure is correct.
I don't know if I'm wrong or if the IPMITool project will need to take an
action?
Best regards,
Stephane Filion
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel