avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Badura <stefan.bad...@globallogic.com>
Subject AVRO: compilation warning
Date Tue, 28 Nov 2017 10:19:27 GMT
Hi,

I'm facing problems with compilation warnings of generated source from avro
scheme (C++, when using flag: Wtype-limits) -> "comparison of unsigned
expression < 0 is always false [-Wtype-limits]"

The problem is, that enum default type value starts from 0 and
in codec_traits there is comparison to size_t (which is unsigned), e.g.

...
    size_t index = d.decodeEnum();
    if (index < avro::ENUM_MIN || index > avro::ENUM_MAX)
...

Does somebody have any suggestions how to avoid this (e.g. setting default
value for enum, updating scheme...)

Thank you

Stefan

Mime
View raw message