Suvarna Garge (Editor)

Watcom C C

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Open community

Development status
  
Active

Watcom C/C++

Original author(s)
  
Watcom, Sybase, SciTech Software

Initial release
  
January 8, 2003; 14 years ago (2003-01-08)

Stable release
  
1.9 / June 2, 2010; 6 years ago (2010-06-02)

Preview release
  
2.0 / April 2, 2015; 2 years ago (2015-04-02)

Watcom C/C++ (currently Open Watcom C/C++) is a compiler for C, C++ and Fortran. It was developed by Watcom International Corporation.

Contents

History

Though no longer sold commercially by Sybase, the Watcom C/C++ compiler and the Watcom Fortran compiler have been made available free of charge – for non commercial usage, as the Open Watcom package.

The Open Watcom C/C++ version 1.4 release on December 2005 introduced Linux x86 as an experimental target, supported from NT or OS/2 host platforms. There is code for an abandoned QNX version, but libraries necessary for it to be compiled could not be released as open source.

Stable version 1.9 was released in June 2010.

A forked version 2.0 beta was released that supports 64-bit hosts (Windows and Linux), built-in text editor, 2-phase build system, and the DOS version supports long filenames (LFN).

Release history

The Open Watcom Wiki has a comprehensive history.

License

The Open Source Initiative has approved the license as open source, but Debian, Fedora and the Free Software Foundation have rejected it because "It requires you to publish the source code publicly whenever you “Deploy” the covered software, and “Deploy” is defined to include many kinds of private use."

Design

The compiler can be operated from, and generate executable code for, the DOS (MS-DOS, FreeDOS), OS/2, Windows, Linux operating systems. It also supports NLM targets for Novell NetWare. There is ongoing work to extend the targeting to Linux and modern BSD (e.g., FreeBSD) operating systems, running on x86, PowerPC, and other processors.

The code is portable and, like many other open source compiler projects such as GCC or LCC the compiler backend (code generator) is retargetable.

Uses

In the mid-1990s some of the most technically ambitious MS-DOS computer games such as Doom, Descent, Duke Nukem 3D, and Rise of the Triad were built using Watcom C/C++, some such as ROTT using the DOS/4GW protected mode extender with the Watcom compiler.

It was used to port the game Retro City Rampage to MS-DOS in 2015.

Variants

There is an unofficial fork of Open Watcom V2 on GitHub. A variant of the 16bit DOS CRT library startup was created with WASM.

Compatibility

Open Watcom's syntax supports many conventions introduced by other compilers, such as Microsoft's and Borland's, including differing conventions regarding (for instance) the number of leading underscores on the "asm" tag. Code written specifically for another compiler rather than standard-compliant C or C++ will often compile with the Watcom compiler.

The compiler supports C89/C90 standards by default.

Open Watcom supports partial compatibility with the C99 standard. It implements the most commonly used parts of the standard. However, they are enabled only through the undocumented command-line switch "-za99". Three C99 features have been bundled as C90 Extension since pre-v1.0: C++ style comments (//), flexible array members, trailing comma allowed in enum declaration.

The compiler currently doesn't support any new major C11 features, though the C library does include "Safe C" functions. It is specified in ISO/IEC TR 24731-1 and known as "Bounds-checking interfaces (Annex K)" in C11. Some function name examples are strcpy_s(), memcpy_s(), printf_s(). This library was released along with Open Watcom 1.5 in April 2006.

References

Watcom C/C++ Wikipedia