Re: Is it possible to generate a compile time error from an inline function?

Liste des GroupesRevenir à l c 
Sujet : Re: Is it possible to generate a compile time error from an inline function?
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 14. Jul 2024, 22:50:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v71dmv$a6is$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla Thunderbird
On 14/07/2024 21:14, Keith Thompson wrote:
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.
 
That is a lot more accurate than the way I described it.
However, it is the case that the C compilers have historically picked up features from their sibling C++ compilers as extensions.  They don't get things that are directly counter to the way C works, and the good features have often made it into later C standards.
So yes, separate applications but with some code sharing is a better way to put it.

Date Sujet#  Auteur
13 Jul 24 * Is it possible to generate a compile time error from an inline function?15Alan Mackenzie
13 Jul 24 +* Re: Is it possible to generate a compile time error from an inline function?10David Brown
13 Jul 24 i`* Re: Is it possible to generate a compile time error from an inline function?9Alan Mackenzie
13 Jul 24 i `* Re: Is it possible to generate a compile time error from an inline function?8Richard Damon
13 Jul 24 i  +* Re: Is it possible to generate a compile time error from an inline function?6Alan Mackenzie
13 Jul 24 i  i`* Re: Is it possible to generate a compile time error from an inline function?5Richard Damon
14 Jul 24 i  i +- Re: Is it possible to generate a compile time error from an inline function?1Kenny McCormack
14 Jul 24 i  i `* Re: Is it possible to generate a compile time error from an inline function?3David Brown
14 Jul 24 i  i  `* Re: Is it possible to generate a compile time error from an inline function?2Keith Thompson
14 Jul 24 i  i   `- Re: Is it possible to generate a compile time error from an inline function?1David Brown
14 Jul 24 i  `- Re: Is it possible to generate a compile time error from an inline function?1David Brown
13 Jul 24 `* Re: Is it possible to generate a compile time error from an inline function?4Tim Rentsch
14 Jul 24  `* Re: Is it possible to generate a compile time error from an inline function?3Alan Mackenzie
15 Jul 24   +- Re: Is it possible to generate a compile time error from an inline function?1Kaz Kylheku
16 Jul 24   `- Re: Is it possible to generate a compile time error from an inline function?1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal