|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
c++.windows.32-bits - Compiling C programs from previous Zortech/Symantec compilers
Re.: Compiling C programs from previous Zortech/Symantec compilers
We have several programs written in previous versions of
Zortech/Symantec C (no C++), which we wish to convert to compile
with Digital Mars. (Zortech C/C++ and Symantec C/C++ are
predecessors of Digital Mars).
Most of the programs consist of several C modules compiled and
linked with a Large Memory module: we have used this approach
because the resultant executables have been found to run on all
versions of Windows from 3.1 through 9/98/2k/2k3/XP and now Vista.
We are trying to use the IIDE for these projects, which have
previously been compiled and linked at the command line. However,
when we try to compile the programs in DM, we encounter rather too
many errors and issues, and wondered whether anyone may be able to
help.
ISSUE 1
we do not seem to be able to change the Memory Model for
compilation: it is restricted to "Flat".
ISSUE 2
Issue two occurs early in the compilation of the first module and
results in the compiler ceasing to process code after the include
statement:
#include <drivinit.h>
However the compiler continues to count lines (even thought the
count grossly exceeds the line count of our projects!) until it
fails and issues the report:
============ complier output report ===========================
sc Persw.c -p -mn -o+time -WA -3 -a8 -c -H -HO- -
IC:\SW_Tools\DigiMars\include -oPersw.obj
nbytes = 65520, ph_maxsize = 65520
Fatal Error: C:\SW_Tools\DigiMars\include\win32\drivinit.h(2):
internal error ph 1817
Lines Processed: 645805 Errors: 1 Warnings: 0
Build failed
================================================================
ISSUE 3
If we remove the Include line which generates ISSUE 1, the
compiler stops and reports many problems relating to a need to
introduce explicit casts into our code. This is code that compiles
and runs correctly under the previous versions.
Some examples of the code, and the errors generated are:
============= CODE SAMPLE A =====================================
BOOL InitApplication (hInstance)
HANDLE hInstance;
{
int count;
WNDCLASS wc;
wc.style = NULL;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon (hInst, "PERSWIcon");
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject (LTGRAY_BRUSH);
wc.lpszMenuName = "PERSWMenu";
wc.lpszClassName = "PERSWClass";
return (RegisterClass (&wc));
}
==================== COMPILER OUTPUT =========================
sc Persw.c -p -mn -o+time -WA -3 -a8 -c -H -HO- -
IC:\SW_Tools\DigiMars\include -oPersw.obj
Error: K:\PERS-SYS\DigiMarsTest\Persw.c(850): need explicit cast
to convert
K:\PERS-SYS\DigiMarsTest\Persw.c(850): from: void *
K:\PERS-SYS\DigiMarsTest\Persw.c(850): to : unsigned
==============================================================
This error references the line:
wc.style = NULL;
in the above code.
There are many errors of this type, for example:
================ CODE SAMPLE B ===============================
Referencing the line below from CODE SAMPLE A above:
wc.lpfnWndProc = MainWndProc;
we have defined the function MainWindowProc as:
long FAR PASCAL MainWndProc (HWND, unsigned, WORD, LONG);
in our include file for the Project.
This generates the error:
Error: K:\PERS-SYS\DigiMarsTest\Persw.c(851): need explicit cast
to convert
K:\PERS-SYS\DigiMarsTest\Persw.c(851): from: long (*std func)(void
*,unsigned ,unsigned short ,long )
K:\PERS-SYS\DigiMarsTest\Persw.c(851): to : long (*std func)(void
*,unsigned ,unsigned ,long )
So can anyone advise us on any of these issues, or do we have to
go back to our old compiler and forget about tryoing to use the
later versions of Digital Mars ?
Regards and thanks in advance,
Kenneth Spencer
May 11 2007
Kenneth Spencer wrote:Re.: Compiling C programs from previous Zortech/Symantec compilers We have several programs written in previous versions of Zortech/Symantec C (no C++), which we wish to convert to compile with Digital Mars. (Zortech C/C++ and Symantec C/C++ are predecessors of Digital Mars). Most of the programs consist of several C modules compiled and linked with a Large Memory module: we have used this approach because the resultant executables have been found to run on all versions of Windows from 3.1 through 9/98/2k/2k3/XP and now Vista. We are trying to use the IIDE for these projects, which have previously been compiled and linked at the command line. However, when we try to compile the programs in DM, we encounter rather too many errors and issues, and wondered whether anyone may be able to help. ISSUE 1 we do not seem to be able to change the Memory Model for compilation: it is restricted to "Flat". Jul 11 2007
|