Sujet : Re: Is it possible to generate a compile time error from an inline function?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 14. Jul 2024, 20:14:10
Autres entêtes
Organisation : None to speak of
Message-ID : <878qy3ss59.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.13 (Gnus v5.13)
David Brown <
david.brown@hesbynett.no> writes:
On 13/07/2024 20:07, Richard Damon wrote:
[...]
The question being since most C compilers are also C++ compilers,
they somethings accept this sort of C++ism as an extension.
>
Actually, the vast majority of C compilers are /not/ also C++
compilers. But the most popular C compilers, by a significant
margin, are C++ compilers.
I wouldn't quite put it that way.
gcc, clang, and Microsoft provide both C and C++ compilers, but they're
separate applications, perhaps invoked from a common driver program.
They typically share the same backend, but the frontends are separate.
I wouldn't expect to see any code that parses "int class;" and decides
whether it's a syntax error based on which language is being compiled.
The C and C++ frontends might share some code, but they're separate
applications.
[...]
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */