Liste des Groupes | Revenir à l c |
James Kuyper <jameskuyper@alumni.caltech.edu> writes:There are also things that are VLA's in C, but ordinary arrays in C++, and acceptable in both languages :Muttley@dastardlyhq.org wrote:g++ and clang++ both do so: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.
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.)
Les messages affichés proviennent d'usenet.