• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

OpenWatcom versus GCC

Started by madcrow, 2009.12.09, 05:10:50

Previous topic - Next topic

madcrow

Which is the better compiler for OS/2 at the moment. Obviously OW has the advantage of producing .EXEs that need external runtimes in order to run, but it also has the disadvantage of being more old fashioned in terms of language features that it supports, especially on the C++ side. Does anyone have recomendations here?

Radek

I am using Watcom all the time. It is cross-platform, so if you need a bit of code for DOS VM, no problem. You get full support for DOS sessions. It also contains an enough good IDE. It produces EXEs which do not need any "runtime DLLs". If allows enough flexible inline assebler coding. It produces efficient EXEs.

IMO, disadvantages:
- Not good support for writing drivers. Even if OS/2 drivers are now written in OW (OW allows 16-bit coding), you will link "by hand" a you will need to bypass certain OW defaults.
- Not complete support for .DEF files. This can be a problem when you write a big project which does not fit in OW standards.
- Not good support for creating .INF files. You can write .INFs - but you cannot create a "master" which includes "chapters" and add all this to the IDE project. You need to compile only the "master" but IDE will pass to ipfc all .inf's in your project.

GCC - I have no direct experience. I am using GCC from CodeBlocks in Linux :)  If you plan porting from other platforms then vote for GCC, though. Everything you will port will be written in GCC.
GCC wasn't written for OS/2, it was ported. Therefore GCC has no "special support" for OS/2. On the other hand, OS/2 versions of Watcom existed for a long time so that Watcom has the support.

Andi

Most times the choice of compiler depends on the project you want to participate or take over. If you start a new project or just want to start programming for eCS, OW is probably the best solution. The (simple) IDE saves you the effort of dealing with make files and compiler/linker switches which are the most annoying things a developer have to deal with IMHO. As already said for Device Driver development OW is the only choice (beside MASM and other outdated quirks...). You get good readable help files with OW too (.inf). If you're experienced with make files and do not need a IDE, maybe you will not appreciate some of the OW benefits. There seems to be a lack of some special/newer C++ features in OW as you mentioned. In this respect gcc is more up to date.

For xworkplace widgets it wise to stay with IBMCPP3.xx. But for porting *nix software, gcc will be the tool chain of choice.

So it all depends on what you are want to do.