You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2018/11/26 18:28:07 UTC

[avro] branch master updated: Remove warning: comparison of unsigned expression < 0 is always false [-Werror=type-limits]

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 563cfb7  Remove warning: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
563cfb7 is described below

commit 563cfb76e846e307426afd020d3e8c59d29cc1df
Author: jmccl <co...@squotd.net>
AuthorDate: Tue Jun 12 14:16:38 2018 -0700

    Remove warning: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
---
 lang/c++/impl/avrogencpp.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lang/c++/impl/avrogencpp.cc b/lang/c++/impl/avrogencpp.cc
index 149debd..5102f4e 100644
--- a/lang/c++/impl/avrogencpp.cc
+++ b/lang/c++/impl/avrogencpp.cc
@@ -531,7 +531,7 @@ void CodeGen::generateEnumTraits(const NodePtr& n)
 		<< "    }\n"
 		<< "    static void decode(Decoder& d, " << fn << "& v) {\n"
 		<< "		size_t index = d.decodeEnum();\n"
-		<< "		if (index < " << first << " || index > " << last << ")\n"
+		<< "		if (index > " << last << ")\n"
 		<< "		{\n"
 		<< "			std::ostringstream error;\n"
 		<< "			error << \"enum value \" << index << \" is out of bound for " << fn << " and cannot be decoded\";\n"