[CLN-list] More questions about compiler warnings

Jan Rheinländer jrheinlaender at gmx.de
Mon Mar 12 20:20:18 CET 2018


Hi Bruno,

thank you for explaining about the compiler warning. Here are two more:

File include/cln/floatformat.h:

It seems that with MSVC enums always have int as the underlying type.
Therefore the compiler complains about truncation of a constant value
for float_format_lfloat_max.

But it is possible to force the type in this way:

enum float_format_t : sintE {


File src/base/cl_low.h line 1464:

On MSVC x86 the macro "bit(32)" expands to "(1L << 32)" and the compiler
says this is undefined behaviour.

What about changing line 1464 to "(1ULL << 32)" instead? Like in line 1483.


Jan





More information about the CLN-list mailing list