Liste des Groupes | Revenir à cl c |
On 5/26/2024 9:18 AM, David Brown wrote:I think you did misinterpret. Macros in C are not recursive. That stops them exploding, but also means there's a lot you can't do with the preprocessor.On 26/05/2024 01:45, Keith Thompson wrote:I would expect it to immediately explode, because AFAIK the usual preprocessor behavior is to keep expanding macros in a line until there is nothing left to expand.David Brown <david.brown@hesbynett.no> writes:>
[...]The normal way for multi-threaded systems is to implement it as a>
macro. It might be, for example :
>
#define errno __thread_data->_errno
>
or
>
#define errno *errno()
Both of those need more parentheses -- and I'm unconfortable using the
same identifier for the macro and the function.
>
The second example was from the footnote in the C standard's section on <errno.h>, so it can't be /that/ bad!
>
But I agree with your discomfort.
>
Well, granted, it is possible I could have misinterpreted how it was supposed to work and had never noticed...
Les messages affichés proviennent d'usenet.