C portability is a myth

From: roman ziak (news1_at_MYLASTNAME.com)
Date: 02/13/05


Date: Sun, 13 Feb 2005 08:31:13 -0500

I just read couple articles on this group and it keeps amazing me how
the portability is used as strong argument for language cleanliness.

In my opinion, porting the program (so you just take the source code and
recompile) is a myth started 20-30 years ago when world consisted of
UNIX systems. Well, world does not consist of UNIX systems anymore, but
there are 100s of different systems running in cell-phones, DVD players,
game consoles etc. And one of the very few programs which would work on
all these platforms is: "loop: goto loop;".

Another point is that real worls compilers almost never comply to the
standards. So even taking the code from one compiler to another and
recompiling is a myth unless we talk about some real simple one-evening
type of apps.

And the last but not least point is the justification of portability.
Say I write app in 500 hours using all possible compiler extensions.
Does it justify to write it perfectly portale and spend 1500 hours
instead ? In my eyes not, because I can probably write it from scratch
in another 500 hours or play with it a little and probably adjust it to
second platform or different compiler way faster.

To be honest ... to how many different plattforms and/or compilers are
you porting your programs in average ?

And please, before you start sending flames, please introduce the group
into your last project of porting the software between platforms. And
let it not be Win98 -> WinXp ...



Relevant Pages

  • Re: Natural size: int
    ... C's excuse is that not all platforms have overflow detection in the first place, and for those that do the cost of overflow checking may be unacceptable. ... But aside from that, a compiler couldn't detect overflow at compile time, except for very obvious cases that even a C compiler or static checking tool might diagnose. ... Programmers who wouldn't know portability if, to paraphrase Blackadder, "it painted itself purple and danced naked on a harpsichord singing 'portability is here again'". ... Needing functionality that is not defined by the standard, but available on many or most target platforms; or being able to use optional functionality that is available on some platforms, but not all. ...
    (comp.lang.c)
  • Re: C portability is a myth
    ... :And the last but not least point is the justification of portability. ... :Say I write app in 500 hours using all possible compiler extensions. ... to ensure that the programs work on other platforms. ... API version if it can, or tells the display portion the API ranges ...
    (comp.lang.c)
  • Re: function returning a structure
    ... processor vendor, however the operating system and/or compiler vendor ... That depends on what you mean with portability. ... then the ABI's of the different platforms do not have any effect on ... If you are writing a compiler for a particular platform, ...
    (comp.std.c)
  • Re: What is the most compiler close to gcc in unix?
    ... >Gcc is available on most Unix platforms. ... >compiler on different platforms does not in general ensure portability. ...
    (comp.unix.programmer)
  • Re: C portability is a myth
    ... portability has to do with availability, ... I am not convinced yet that it isn't a compiler bug (I saw ... >> was the C standard itself which was the culprit in causing the ... Porting requires effort regardless of whether or not I have conformed ...
    (comp.lang.c)

Loading