Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Fri, 04 Apr 2025 19:15:50 -0700 Organization: None to speak of Lines: 38 Message-ID: <85semnica1.fsf@nosuchdomain.example.com> References: <87y0wjaysg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 05 Apr 2025 04:16:10 +0200 (CEST) Injection-Info: dont-email.me; posting-host="959afc724390e84815a36c37a7f67456"; logging-data="1070926"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QVa4UD/UCigIE/amUWhhm" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:TML2ywMrZjYEZha5SAKMCrNw7RE= sha1:izxxMgcKz9dEupiavtcrOlx8oG8= James Kuyper writes: > Muttley@dastardlyhq.org wrote: >> On Wed, 2 Apr 2025 14:12:18 -0000 (UTC) >> antispam@fricas.org (Waldek Hebisch) wibbled: > ... >>>C99 has VMT (variable modified types). Thanks to VMT and complex types >>>C99 can naturaly do numeric computing that previously was done using >>>Fortran 77. Offical C++ has no VMT. C++ mechanizms look nicer, >> >> Officially no, but I've never come across a C++ compiler that didn't support >> them given they're all C compilers too. > > There exist many programs that can compile either C code and C++ code, > depending either upon the extension of the file name or explicit command > line options to determine which language's rules to apply. That doesn't > qualify. Do you know of any compiler that accepts VMTs when compiling > according to C++ rules? If so, please provide an example. It will help > if the code has some features that are well-formed code in C++, but > syntax errors in C, to make it clear that C++'s rules are being implemented. g++ and clang++ both do so: int main() { class foo { }; int len = 42; int vla[len]; } Both warn about the variable length array when invoked with "-pedantic" and reject it with "-pedantic-errors". Microsoft's C and C++ compilers do not support VLAs. (Their C compiler never supported C99, and VLAs were made optional in C11, so that's not a coformance issue.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */