This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: sizeof( struct) in DOS( borlandc) is different in GNU (linux)
- To: Jose Freddy Rojas Chavarria <freddy at ns dot dgct dot ice dot go dot cr>
- Subject: Re: sizeof( struct) in DOS( borlandc) is different in GNU (linux)
- From: Wayne Meissner <w dot meissner at qut dot edu dot au>
- Date: Fri, 12 Sep 1997 15:00:35 +1000 (EST)
- Cc: gnu-win32 at cygnus dot com
This wasn't exactly a gnu-win32 question, but it applies to it as well ...
On Thu, 11 Sep 1997, Jose Freddy Rojas Chavarria wrote:
>
> I have a binary files recorded by a program in BorlandC for DOS, and I
> can't read this file in Linux.
>
> The file is a colection of records of the type
> struct {
> char usr_id;
> long info;
> }T_info;
You need to declare this as
struct {
char usr_id;
long info;
} __attribute__((__packed__)) T_info;
(syntax is similar to this, I haven't got the info pages here with me).
Or just recompile the file with -fpack-struct, but this makes all structs
compiled with byte packing (including ones declared in system include
files).
Read the gcc info pages.
--wayne
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".