Walter Roberson said:
As a fellow sysadmin who also does software development
(some scientific, some tools for administration purposes), I would
ask where you find the *time* to make meaningful programs that are
completely portable and bug free?
Writing mostly-portable code is generally faster than writing
implementation-specific code twice. For those cases where it is not
more efficient (or not possible), you modularize it as much as possible
and make sure the implementation-specific parts are not compiled/linked
on any system they have not been verified on.
Do you take the next 2 or 3 decades to invent a new form of
logical or mathematical analysis to solve the "corner case" just
so you "_know_" the program will work? Or do you document
the condition, put in a smooth failure mode for it, and let it go?
Writing implementation-specific code is fine, though OT for comp.lang.c.
Just make sure you _know_ it's such, document it, and make a reasonable
effort to ensure people won't use it on the wrong platform. In many
environments, just commenting "requires Win32" or "requires POSIX" is
sufficient.
The issue in this thread is that someone responded with code that
happens to work on an implementation or two without any disclaimers as
to it being unportable, then defended it with the completely irrelevant
argument that one vendor of extremely unportable software happens to use
it.
If you're going to post here, make your code portable or suggest another
newsgroup where an unportable solution can be adequately peer-reviewed.
"It works on my system" is not good enough.
S