Re: [Freedos-devel] Fwd: [Freedos-kernel] Error compiling ...

2009-02-26 Thread Alain M.
This looks like a real error to me !!!

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...

Alain

Aitor SantamarĂ­a escreveu:
 Sending over here too, as this list is more popular, and in case
 someone is not reading there and can contribute.
 
 Aitor
 
 
 -- Forwarded message --
 From: Hans han...@ht-lab.com
 Date: 2009/2/15
 Subject: Re: [Freedos-kernel] Error compiling ...
 To: freedos-ker...@lists.sourceforge.net
 
 
 The easy fix to this is use Watcom 1.2.
 
 Hans
 www.ht-lab.com
 
 
 - Original Message -
 From: George Petculescu
 To: freedos-ker...@lists.sourceforge.net
 Sent: Sunday, February 15, 2009 4:07 PM
 Subject: [Freedos-kernel] Error compiling ...
 Hello,
 
 I have a problem while compiling FreeDOS Kernel.
 I use latest version of Open Watcom and NASM 0.98. I recive the next error:
 
 Process BOOT +++
 
 
 Process SYS 
 
 wcc -Ic:\watcom\H -I..\hdr -DFORSYS -DWITHFAT32 -zq-zp1-os-s-we-e3-wx sys.c
 sys.c(1050): Warning! E1176: Parameter 2, pointer type mismatch
 sys.c(1050): Note! I2003: source conversion type is 'unsigned short *'
 sys.c(1050): Note! I2004: target conversion type is 'unsigned int *'
 sys.c(1050): Note! I2002: '_dos_allocmem' defined in: c:\watcom\H\dos.h(161)
 sys.c(1079): Warning! E1176: Parameter 2, pointer type mismatch
 sys.c(1079): Note! I2003: source conversion type is 'unsigned short *'
 sys.c(1079): Note! I2004: target conversion type is 'unsigned int *'
 sys.c(1079): Warning! E1176: Parameter 3, pointer type mismatch
 sys.c(1079): Note! I2003: source conversion type is 'unsigned short *'
 sys.c(1079): Note! I2004: target conversion type is 'unsigned int *'
 sys.c(1079): Note! I2002: '_dos_getftime' defined in: c:\watcom\H\dos.h(188)
 Error(E42): Last command making (sys.obj) returned a bad status
 Error(E02): Make execution terminated
 Compilation was aborted!
 
 What is the problem ? Should I wrong something in config.bat file ?
 Thanks,
 George.
 
 
 
 --
 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-kernel mailing list
 freedos-ker...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/freedos-kernel
 
 --
 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-kernel mailing list
 freedos-ker...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/freedos-kernel
 
 --
 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
 
 

--
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


Re: [Freedos-devel] Fwd: [Freedos-kernel] Error compiling ...

2009-02-26 Thread Blair Campbell
 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.

--
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


Re: [Freedos-devel] Fwd: [Freedos-kernel] Error compiling ...

2009-02-26 Thread Christian Masloch
 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:

 - 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.

This is from  
http://openwatcom.org/index.php/C_Compilers_Release_Changes#List_of_changes_in_Open_Watcom_1.8

Regards,
Christian

--
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


Re: [Freedos-devel] Fwd: [Freedos-kernel] Error compiling ...

2009-02-26 Thread Alain M.
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