Anyway, here's my probably unneeded warning, when using the Field command. My FB code is:
Code: Select all
Type datatype Field = 1
As Integer v1
As UByte v2
As Byte v3
End Type
Dim As datatype dt
Code: Select all
D:\Programs\FreeBASIC\fbc -gen gcc "test2.bas"
test2.c:16: warning: 'packed' attribute ignored for field of type 'ubyte'
test2.c:17: warning: 'packed' attribute ignored for field of type 'byte'
Make done
Code: Select all
// Compilation of test2.bas started at 16:55:17 on 04-18-2013
typedef char byte;
typedef unsigned char ubyte;
typedef unsigned short ushort;
typedef int integer;
typedef unsigned int uinteger;
typedef unsigned long ulong;
typedef long long longint;
typedef unsigned long long ulongint;
typedef float single;
typedef struct _string { char *data; int len; int size; } string;
typedef char fixstr;
typedef ushort wchar;
typedef struct _DATATYPE {
integer V1 __attribute__((packed));
ubyte V2 __attribute__((packed));
byte V3 __attribute__((packed));
} DATATYPE;
void __attribute__((stdcall)) fb_Init( integer, char**, integer );
void __attribute__((stdcall)) fb_End( integer );
typedef struct _$fb_RTTI $fb_RTTI$type;
typedef struct _$fb_RTTI {
void* STDLIBVT;
char* ID;
$fb_RTTI$type* PRTTIBASE;
} $fb_RTTI;
extern $fb_RTTI$type __fb_ZTS6Object;
integer main( integer __FB_ARGC__$, char** __FB_ARGV__$ )
{
integer fb$result$;
DATATYPE DT$;
#define vr$0 ((integer*)(&fb$result$))
__builtin_memset( vr$0, 0, (integer)4 );
fb_Init( __FB_ARGC__$, __FB_ARGV__$, (integer)0 );
label$0:;
#define vr$1 ((DATATYPE*)(&DT$))
__builtin_memset( vr$1, 0, (integer)6 );
label$1:;
fb_End( (integer)0 );
#define vr$2 ((integer)(fb$result$))
return vr$2;
}
// Total compilation time: 0.0001004800000772299 seconds.
Oh, and I'm using Window 7 64bit, the "FreeBASIC Compiler - Version 0.24.0 (08-19-2012) for win32" and the GCC compiler is the one that comes bundled with CodeBlocks, no idea what version.