There are probably no particular advantages, because if portable code is your goal, you will usually try to limit your code to the standard subset implemented by all compilers. I would say that the lowest common denominator, but may seem somewhat derogatory.
The advantages of one compiler over another usually lie in the extensions it provides, in the libraries that it includes, or in the performance of the generated code, if your portability is your goal, you probably are not interested either. These are not the advantages of one compiler over another that should be of interest to you in this case, but rather its compliance and compliance with ISO standards.
In its earlier commercial incarnation, Watcom was famous for being one of the best optimizing compilers; I doubt, however, that he has kept up with the development of the processor since (or even switching for 16 bits to 32 bits x86!).
Its only function, which can be seen as an advantage in some cases, is that it supports DOS, OS / 2, and Windows, but this is probably only an advantage if the goal is to maintain legacy systems. Efforts to port it to Linux and BSD and non-x86 processors exist, but are not complete, and GCC has been around for many years.
I would suggest that if you can support GCC and VC ++, you probably have sufficient compiler independence (but it is recommended that you compile with high-level warning settings ( -Wall -Werror
in GCC and \W4 \Wx
in VC ++ ). I believe that compiler portability is a trivial issue compared to OS portability, and what you really need to consider is cross-platform library support, not code-independent code support.
If, however, playing with compilers is your thing, also consider the Digital Mars compiler. Like Watcom, it also has a commercial compiler legacy being a Zortech / Symantec C / C ++ compiler in a previous life.
Clifford
source share