Closed frederick-vs-ja closed 1 year ago
Sure. If you want to write that paper, you can and should write it. I don't really have the energy / bandwidth to do so, though. It looks like you already understand that this hints at potential C++ namespace stuff, so I'm sure you know to be careful if you write such a paper.
Microsoft UCRT's type-generic macros are broken because they directly refer to C standard library functions with their names. E.g.
As a result, a locally declared function pointer can alternate the behavior of these macros, which is non-conforming (reported here, for
sqrt
andsqrtf
).A conforming implemention may need to use additional functions with _Ugly names (shown in N3096):
IMO this is adding unnecessary complexity. I believe the proper resolution is adding
::
("file scope resolution operator") to C, with which we can make macros more robust like this:Note that C++ namespaces can and perhaps should be avoided.
::
should only make identifiers found in the file scope in C.