delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/12/03:38:56

Date: Sun, 12 May 1996 10:32:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: j DOT aldrich6 AT genie DOT com
Cc: djgpp AT delorie DOT com
Subject: Re: more sizeof questions
In-Reply-To: <199605120016.AA213930191@relay1.geis.com>
Message-Id: <Pine.SUN.3.91.960512102751.25343N-100000@is>
Mime-Version: 1.0

On Sun, 12 May 1996 j DOT aldrich6 AT genie DOT com wrote:

> 2)  Conditionally pack the structure only if you are using a GNU compiler,

Most 32-bit compilers pad structs to avoid significant runtime penalty 
for unaligned accesses.  So, conditioning that code on GCC alone is not 
exactly the correct procedure.  You should use some symbol that implies a 
32-bit compiler.

> BTW, doesn't Turbo C suck?  I had a program that used ftruncate in
> <unistd.h>, only to discover that TC has no such library and no such
> function.  I had to write two different sections of code, one for Turbo C
> and one for real compilers.  :(

There are many headers in any Unix program that cannot be found on any
other DOS compiler except DJGPP; unistd.h is only one of them.  This is
one of the main problems that make porting a Unix programs to the other
compilers a programmer's nightmare. 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019