Re: integer size and portability-a wishful controversy
From: Dan Pop (Dan.Pop_at_cern.ch)
Date: 03/17/04
- Next message: Bryan Bullard: "Re: Linker error in call from C to ASM"
- Previous message: Dan Pop: "Re: Borland C++ vs. Microsoft C++?"
- In reply to: CBFalconer: "Re: integer size and portability-a wishful controversy"
- Next in thread: Keith Thompson: "Re: integer size and portability-a wishful controversy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 17 Mar 2004 14:00:27 GMT
In <40575174.520B9B46@yahoo.com> CBFalconer <cbfalconer@yahoo.com> writes:
>Dan Pop wrote:
>>
>... snip ...
>>
>> You're using an old version of Turbo C, designed for a 16-bit
>> processor and a 16-bit operating system. The Microsoft compiler,
>> OTOH, was designed for a 32-bit processor and a 32-bit operating
>> system. Hence the difference.
>>
>> BTW, there is no point in using the old Turbo C compiler, unless
>> you still have the machine and OS it was originally designed for.
>
>I disagree. It can be very useful in checking for foolish coding
>assumptions. An example would be a piece of code recently posted
>here entitled "GetFileSize()". Another would be any code that
>assumes a pointer can be stored in an int, and then extracted.
These days, a 64-bit platform is more appropriate for this kind of
checking, most of them having (or supporting) the I32LP64 model.
I do NOT consider programs relying on int having at least 32 bits as
being badly designed (these days, int is the de facto 32-bit type, long
being 64-bit on many 64-bit platforms). I consider backward compatibility
to MSDOS as a design flaw, rather than as a positive/desirable feature
for a program written these days. Less than 32-bit int's have been a
feature of freestanding implementations only, for quite a while.
16-bit compilers for PCs are, these days, tools for the experts who
use the PC as an almost freestanding platform for developing/testing
device drivers for various pieces of PC hardware. Of course, such
code is non-portable by definition. It is, nevertheless, extremely
helpful to someone wanting to write a device driver for the same
piece of hardware for a real OS.
Another example is test suites for various pieces of PC hardware.
The final product fits on a single bootable diskette that works
regardless of the OS actually installed on the machine. I have even
seen such diskettes for applying firmware upgrades/patches to various
types of IDE hard disks.
But I wouldn't want such software to be developed by people like the OP...
Dan
-- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de
- Next message: Bryan Bullard: "Re: Linker error in call from C to ASM"
- Previous message: Dan Pop: "Re: Borland C++ vs. Microsoft C++?"
- In reply to: CBFalconer: "Re: integer size and portability-a wishful controversy"
- Next in thread: Keith Thompson: "Re: integer size and portability-a wishful controversy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|