Open elfring opened 5 years ago
This has been brought up a few times in the past. From what I recall, the decision was to avoid populating auto-complete suggestions with internal macros that shouldn't be used. Something like _wi_MACRO
might be a viable alternative, but __WI
is unique enough that I don't think that this is likely to get addressed
How do you think about to avoid that this software depends on undefined behaviour?
They wrote the compiler :P
Do the provided source files belong to the implementation of a compiler for the programming language “C” or “C++”?
C++
thanks for pointing this out. I was aware of _Upper, but not the __doubleUnderscore rule. What do you suggest and what conventions exist that we could follow that meets the goals of
WIL_RESOURCE__
would be good enough.
Carefully placed #undef
-s might help, but that is the path peppered with shards of glass...
The probability for name clashes can be considerably reduced, can't it?
It would be great if something can be done about this since the apparent original intent - making development less noisy for users of the library - is now turned into the opposite for users that also apply e.g. clang diagnostics to their codebase - which can be worked around by adding #pragma clang diagnostic ignored "-Wreserved-identifier"
to any code block using functionality like RETURN_IF_FAILED
, but if there's lots of code using these WIL features, it kinda makes it a bit pointless to enable that warning at all.
I would like to point out that an identifier like “
__WIL_RESOURCE
” does eventually not fit to the expected naming convention of the C++ language standard. Would you like to adjust your selection for unique names?