Sujet : Re: encapsulating directory operations
De : rjh (at) *nospam* cpax.org.uk (Richard Heathfield)
Groupes : comp.lang.cDate : 30. May 2025, 11:54:32
Autres entêtes
Organisation : Fix this later
Message-ID : <101c2p8$eeca$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Mozilla Thunderbird
On 30/05/2025 10:20, David Brown wrote:
On 29/05/2025 14:38, Richard Heathfield wrote:
This really is a very simple point, but perhaps a simple analogy will help to clarify it. You don't throw out your 3/4" just because you've bought a 19mm. There is room for both in the toolbox, and why write 3/4" on your new spanner? It /isn't/ a 3/4" spanner even though it's very like it, so why pretend otherwise?
>
Your analogy does not cover C99 vs C90.
It does if we can construct a program that is legal C90 but not legal C99, which is easy enough, or (slightly harder but still not that hard) a program that is legal in both dialects but which gives different output under C99 than it does for C90.
$ cat c9099.c;gcc -W -Wall -ansi -pedantic -o c90 c9099.c;gcc -o c99 c9099.c;./c90;./c99
#include <stdio.h>
int main(void)
{
int a = 42;
int b = a //* comment */ 6;
;
printf("Soln = %d\n", b);
return 0;
}
Soln = 7
Soln = 42
Obviously it's a contrived example, but then examples pointing out the consequences of language differences invariably are.
-- Richard HeathfieldEmail: rjh at cpax dot org dot uk"Usenet is a strange place" - dmr 29 July 1999Sig line 4 vacant - apply within