nemtrif / utfcpp

UTF-8 with C++ in a Portable Way
Boost Software License 1.0
1.58k stars 200 forks source link

Suppress sign-conversion warning on append #95

Closed Finkman closed 2 years ago

Finkman commented 2 years ago

Since #92 is not really fixed, we should suppress the compiler warning. I was hardly figuring out a solution without suppression, but to have the append as generic as it is right now, it is kind of unpredictable which type the overload resolution will pick for *(result++)*. It could be anoperator=(T)as well a reference to a typeT`. Nevertheless, if we let the compiler choose and be aware that target of the assignment can handle the byte-value there is no change to be error prone. Anyway, it should be made explicit to let the compiler choose what ever it might find suitable which may imply an implicit sign-conversion. That's the reason I'd appreciate to accept the PR or to fix it in any other way so the compilers a de-stressed.

nemtrif commented 2 years ago

I really don't want compiler-specific pragmas in the source code. The pragmas can be easily put around #includes for utfcpp in the callers' code.

Finkman commented 2 years ago

Yes, they could, but this would effect to suppress that warning on the entire library code. I guess there should be a fix in anyway where the code compiles without any errors and warnings.