Christian Masloch escreveu:
>>> You can cast a short to an int, an the conversion in ok, but to cast a
>>> short* to an int* will bring in 2 extra bytes and an INVALID POINTER...
>> no short * and int * are the exact same size in 16-bit compilers (try
>> compiling a test program which prints sizeof(int), sizeof(short).  For
>> some reason openwatcom thinks it's an error.
> 
> I don't know why "unsigned short" to "unsigned int" should be an error if  
> they're the same size (probably so code doesn't get unportable due to  
> this?), but the new OW 1.8 had changes regarding both _dos_allocmem and  
> _dos_getftime. These either caused the warnings or they solved them (if  
> they occured in 1.7) but I think the former:

Ok, I allways use OW for 32 bit programs... for 16 bit it is ok, but at 
least not recomended.

Using the link in the other message I found this, which plainly explains 
how this problem came around:

     *  The date and time arguments to _dos_getftime() and 
_dos_setftime() are now using 'unsigned int' type instead of 'unsigned 
short'. This change has been made to improve compatibility with other 
compilers.

     * The segment argument used with _dos_allocmem(), _dos_freemem() 
and _dos_setblock() is now unsigned int instead of unsigned short. This 
change was made for compatibility with other compilers.

A fix for this would requide conditionals based no the compiler 
version... really not nice at all :(

Alain

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to