Liste des Groupes | Revenir à c theory |
Richard Heathfield <rjh@cpax.org.uk> writes:I was unintentionally ambiguous, for which I apologise.
[...]ALL C compilers are required to diagnose ALL syntax errors and ALLYes, all conforming C compilers are required to do that. (Well,
constraint violations.
strictly speaking they're only required to issue at least one diagnostic
for any translation unit that violates a syntax rule or constraint.)
[...]I was talking about conforming mode, which IIRC (it's been a while) is invoked by -W4 (a warning level that I habitually used in the days when I still used Microsoft software).
In my experience, Microsoft's C compiler - although not perfect - isI wouldn't, since few if any C compilers are conforming by default.
pretty good at following conformance rules. I'd be surprised to learn
from a competent source that it misses a syntax error.
I've just tried 4 different C compilers (gcc, clang, and tccCould you crank MSVS up to -W4 (or whatever the max is these days) and try again? I hate to impose, but of course it's your own fault for qualifying as a competent source. ;-)
on Ubuntu, MS Visual Studio 2022 on Windows), and none of them
diagnosed a stray semicolon at file scope *by default*. gcc and
clang can be persuaded to diagnose it. tcc, as far as I can tell,
cannot; I don't believe it claims to be fully conforming in any mode.
I wasn't able to get MSVS to diagnose it, but there could easily
be an option that I'm missing.
If I wanted to prove something in mathematical logic using C code asSo would I, if only to fend off pedantic fuss-pots such as... well, me, I suppose...
a vehicle, I personally would try to use fully standard-conforming C.
I *might* consider using a more lax C-like language, such as theLikewise.
language accepted by some C compiler in its default mode -- but I'd
need a good reason to do that, and I'd want a rigorous definition
of anything I use that differs from standard C.
It's possible that olcott's C-like code has well defined behaviorFYI Agda, Lean, and Rocq all offer proof vehicles, and all three are likely to be better suited to the task than is C.
in the implementation he's using. If so, I'm not sure there's any
fundamental reason to use something close to C rather than using C
itself in an attempted refutation of some well known mathematical
proof. (I wouldn't expect either C or something C-like to be a
good vehicle for such a proof. I don't think C is defined rigorously
enough to be useful for such a task, and any C-like language is even
less so.)
olcott will likely use this to claim that I support his views.It hardly matters. A crank is a crank is a crank.
He will be wrong.
Les messages affichés proviennent d'usenet.