[comp.std.c] Definition of "conforming"

volpe@camelback.crd.ge.com (Christopher R Volpe) (04/03/91)

Here's an interesting question on terminology. Section 1.7 states
that "A conforming program is one that is acceptable to a conforming
implementation." Now, does that mean that THERE MUST EXIST at least
one conforming implementation that accepts it, or that it is possible
that an implementation accept it and still be conforming? (I assume that
"accept" means "generate code without issuing any diagnostics", otherwise
any program could be a conforming program)

For example, suppose when given the following program

         #include <stdio.h>
         int main(void)
         { 
            printf("Hello world\n\n\n\n");
            return 0;
         }

every compiler in existance outputted a diagnostic:
"foo.c: Warning: Your fly is open"

Would this program be non-conforming because no compiler accepts it?
Or would it be conforming because it's *possible* for a conforming
implementation to accept it?

Just curious...

==================
Chris Volpe
G.E. Corporate R&D
volpecr@crd.ge.com

gwyn@smoke.brl.mil (Doug Gwyn) (04/03/91)

In article <18160@crdgw1.crd.ge.com> volpe@camelback.crd.ge.com (Christopher R Volpe) writes:
-Here's an interesting question on terminology. Section 1.7 states
-that "A conforming program is one that is acceptable to a conforming
-implementation." Now, does that mean that THERE MUST EXIST at least
-one conforming implementation that accepts it, or that it is possible
-that an implementation accept it and still be conforming? (I assume that
-"accept" means "generate code without issuing any diagnostics", otherwise
-any program could be a conforming program)

No, the only use for "conforming program" is political -- we didn't
want to say that correct but implementation-dependent programs could
not be "conforming" in some sense.  The useful distinction is between
programs that are STRICTLY conforming and those that are not.

-For example, suppose when given the following program
-         #include <stdio.h>
-         int main(void)
-         { 
-            printf("Hello world\n\n\n\n");
-            return 0;
-         }
-every compiler in existance outputted a diagnostic:
-"foo.c: Warning: Your fly is open"
-Would this program be non-conforming because no compiler accepts it?
-Or would it be conforming because it's *possible* for a conforming
-implementation to accept it?

??  That's a strictly conforming program, so every conforming
implementation will accept it.  The set of strictly conforming
programs is a subset of the set of conforming programs.

jfc@athena.mit.edu (John F Carr) (04/04/91)

In article <15680@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:

>??  That's a strictly conforming program, so every conforming
>implementation will accept it.

The only requirement I remember from the standard is that a single program
with certain properties be compiled correctly.  I think there is a comment
somewhere in the book (possibly not in the standard itself) saying that ANSI
did not want to write an ANSI C verification package.  If a conforming
implementation must do the right thing with "hello world" but is allowed to
fail on a complex program, that implies a restriction on implementation
limits that I don't remember reading.

--
    John Carr (jfc@athena.mit.edu)