[comp.std.c] c POSIX Applications

gwyn@smoke.BRL.MIL (Doug Gwyn) (09/16/90)

In article <120202@linus.mitre.org> cazier@mbunix.mitre.org (Cazier) writes:
>Even after reading the POSIX.1 guide umpteen times I still don't understand
>how one knows whether or not the code you write as a casual programmer is
>POSIX comformant or not. If I've learned to follow ANSI standards, do I assume
>that I'm POSIX compliant...or is it only when I make system calls that I
>really need to worry?

I don't understand the concern.  If you write code that does not rely
on any behavior that the relevant standards don't guarantee, and that
does not violate any injunctions in the standards, then the code will
necessarily be strictly conforming to the standard.

>What about compilers checking for POSIX strictly conforming code?

That's not feasible, because no compiler would be able to tell that
all limits would be obeyed (and only universal behavior is exploited)
during execution.

It sounds like what you are after is some way to check whether an
arbitrary chunk of existing code conforms to the standard, rather
than developing the code to conform in the first place.  My feeling
is that the vast majority of code written without a serious attempt
to conform to C and POSIX standards will in fact be nonconforming.
Thus you might as well simply assume that it isn't.