[Techtalk] portable code :-)

Akkana akkana at shallowsky.com
Sat Feb 2 04:17:34 EST 2002


Jenn Vesperman writes:
> Ooh oooh ooh! We're going to be - maybe - writing an app which needs
> portability. (Contracts under negotiation, massive NDAs, yadda yadda.
> Don't you love the proprietary world? Oh well, it pays.)
> 
> Any chance of a summary? Maybe one that we can post to Linuxchix
> somewhere? 

I helped a bit in contributing to this one, on mozilla.org.

    http://www.mozilla.org/hacking/portable-cpp.html

Generally, the most picky compilers we had were the Irix, HPUX, and
(I think) AIX native compilers.  And eventually we found that it was too
hard to make a large community (none of whom had those compilers) 
stick to all these rules when people weren't actively developing
on any of the picky platforms, so those compilers are no longer
supported and g++ is the pickiest compiler we support now. 
(It's much pickier than Microsoft or Apple, and also supports
fewer C++ constructs; most code that builds and works in gcc
will also work on other platforms, with only a few exceptions).

If you care about portability, use gcc with full warnings (-Wall). 
Gcc will give warnings for many constructs that Mac compilers ignore
completely.  (Not sure how picky the Windows compilers are; our win32
developers turn off warnings because the system headers generate so
many warnings that any new ones are lost in the noise. :-( )

Not all gcc warnings are real problems, but I've fixed many bugs that
would have showed up at compile time if the developer had just had
warnings enabled.

	...Akkana



More information about the Techtalk mailing list