Re: Extent of the "as-if" rule
From: pete (pfiland_at_mindspring.com)
Date: 01/30/04
- Next message: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Previous message: pete: "Re: Extent of the "as-if" rule"
- In reply to: Douglas A. Gwyn: "Re: Extent of the "as-if" rule"
- Next in thread: CBFalconer: "Re: Extent of the "as-if" rule"
- Reply: CBFalconer: "Re: Extent of the "as-if" rule"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 17:36:18 GMT
Douglas A. Gwyn wrote:
>
> Dan Pop wrote:
> > Nope: such programs invoke undefined behaviour,
> > so they cannot be used in testing the conformance.
> > Even if this weren't the case, the action
> > in question could be performed 1e6 years after
> > the program startup...
>
> Your "logic" leads to the conclusion that conformance
> testing is impossible. Fortunately, you are wrong.
I believe that the claim, "Excedes ANSI Specifications",
is already in use. I always interpreted it to mean that the
compiler did not self destruct after translating one program.
And now if I may change change the topic to some old business:
Is it legitimate for a function like puts,
to return at the first sign of EOF, like this:
int puts(const char *s)
{
while (*s != '\0') {
if (putchar(*s) == EOF) {
return EOF;
}
++s;
}
return putchar('\n');
}
or must it keep hammering away, regardless of EOF, like this:
int puts(const char *s)
{
int eof = 0;
while (*s != '\0') {
if (putchar(*s) == EOF) {
eof = 1;
}
++s;
}
return putchar('\n') == EOF || eof != 0 ? EOF : 1;
}
?
-- pete
- Next message: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Previous message: pete: "Re: Extent of the "as-if" rule"
- In reply to: Douglas A. Gwyn: "Re: Extent of the "as-if" rule"
- Next in thread: CBFalconer: "Re: Extent of the "as-if" rule"
- Reply: CBFalconer: "Re: Extent of the "as-if" rule"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|