GNOME Bugzilla – Bug 91867
need a doc on portability
Last modified: 2004-12-22 21:47:04 UTC
This should actually go in gnome-docu/whitepapers I think, then get built automatically for the website. Stuff like bashisms, gnuisms, linux-kernelisms. They don't worry me cos I use all three, but people on other OSes object to them. I have a starting list of "stuff to avoid and why" from gmorten and frb and Alan, but this is hardly something I can write myself.
I had already started one of these, so I pulled it out and updated it over the weekend. It's now mostly done, so I guess this bug is mine.
I have checked in the first version under gnome-devel-docs/articles/portable-programming/C. I have not yet added it to the build process, since I want to encourage a few developers to read it first (anybody have any dirt on Gman that I can use to blackmail him?). Btw, scrollkeeper's categories are fairly pitiful, so it is classified as GNOME|Development|Tutorial at the moment, since that is the closest fit. We really need a GNOME|Development|Articles category, I think.
One very small comment: fnmatch() is made portable in glib with the g_pattern_* functions, and directory reading is portablized with g_dir_* (though I think that's more aimed at Win32 portability than Unix portability).
Also, there should be a bit about printf ("%s", NULL); causing segfaults on Solaris (but resulting in "(nil)" on Linux). And maybe that lots of foo_r (reentrant libc functions) seem to take differing numbers of arguments depending on platform. Cf the Evolution configure.in
Both of Peter's changes have been merged into the latest draft in CVS. We now need to work out what to do with this document so that we can close the bug. Putting it up on the website somewhere (along with the session management one that Federico and Havoc wrote) would be a good idea. It is not sufficient to just package it for distribution -- we should both package it and post it online somewhere.
Closing this, since the document has been written and not too many complaints have come in. Of course, it's an invisible document, since it is only available from CVS at the moment, but there is not really anything I can do about this (whining on mailing lists has had sod all effect).