Open GElliott opened 5 years ago
I've reported the issue to the newlib folks. We'll see what they have to say.
our advice has been to let users do the undef'ing (but to document known conflicts). in v3 we've separated the different unit types into different headers, which will reduce the pain for people who don't deal with certain dimensions of units.
I think the problem is fixed in the v3.x branch, which removed the space between the ""
of operator""
and the following literal, so operator"" _N
->operator""_N
.
I've come across some
ctype.h
implementations that define and leak the macro_N
. This conflicts with the UDL for newtons inunits.h
. Compiler errors result when a user does#include "units.h"
.Example: https://github.com/eblot/newlib/blob/master/newlib/libc/include/ctype.h#L35
Although I think this bug deserves to be written against the particular maintainers of
ctype.h
(e.g.,newlib
), I wonder ifunits.h
should#undef
or#pragma push_macro("_N")
. In any case, I thought this conflict should be documented.I'm using units v2.3.1.