avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiruvalluvan M. G. (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1701) warning: comparison between 'const enum testgen_r::ExampleEnum' and 'const enum testgen::ExampleEnum'
Date Tue, 12 Apr 2016 06:00:32 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15236651#comment-15236651

Thiruvalluvan M. G. commented on AVRO-1701:

Normally, there is no need to compare two different schemas. Here we are testing schema evolution
where the writer and reader schemas are compatible in Avro sense, but are different in C++
viewpoint. The code is the test code which wants to ensure that the enum value read corresponds
to to enum value written.

But instead of making implicit conversion from enum to {{int}} and compare, it is preferable
to make explicit comparison. I've attached a modified patch.

> warning: comparison between 'const enum testgen_r::ExampleEnum' and 'const enum testgen::ExampleEnum'
> -----------------------------------------------------------------------------------------------------
>                 Key: AVRO-1701
>                 URL: https://issues.apache.org/jira/browse/AVRO-1701
>             Project: Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.7.7
>            Reporter: peter liu
>            Assignee: peter liu
>            Priority: Minor
>         Attachments: AVRO-1701-A.patch, AVRO-1701.1.patch
> saw below warning while compiling with g++ 4.2 and g++ 4.8 on mac os and linux
> {quote}
> [ 85%] Building CXX object CMakeFiles/AvrogencppTests.dir/test/AvrogencppTests.cc.o
> In file included from /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/impl/framework.ipp:29:0,
>                  from /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/included/unit_test.hpp:20,
>                  from /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/included/unit_test_framework.hpp:2,
>                  from /Users/liuyanbo/git/avro/lang/c++/test/AvrogencppTests.cc:33:
> /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/test_tools.hpp: In instantiation of
'boost::test_tools::predicate_result boost::test_tools::tt_detail::equal_impl(const Left&,
const Right&) [with Left = testgen_r::ExampleEnum; Right = testgen::ExampleEnum]':
> /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/test_tools.hpp:560:40:   required from
'boost::test_tools::predicate_result boost::test_tools::tt_detail::equal_impl_frwd::call_impl(const
Left&, const Right&, mpl_::false_) const [with Left = testgen_r::ExampleEnum; Right
= testgen::ExampleEnum; mpl_::false_ = mpl_::bool_<false>]'
> /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/test_tools.hpp:575:56:   required from
'boost::test_tools::predicate_result boost::test_tools::tt_detail::equal_impl_frwd::operator()(const
Left&, const Right&) const [with Left = testgen_r::ExampleEnum; Right = testgen::ExampleEnum]'
> /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/test_tools.hpp:523:1:   required from
'bool boost::test_tools::tt_detail::check_frwd(Pred, const boost::unit_test::lazy_ostream&,
boost::test_tools::const_string, std::size_t, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type,
const Arg0&, const char*, const Arg1&, const char*) [with Pred = boost::test_tools::tt_detail::equal_impl_frwd;
Arg0 = testgen_r::ExampleEnum; Arg1 = testgen::ExampleEnum; boost::test_tools::const_string
= boost::unit_test::basic_cstring<const char>; std::size_t = long unsigned int]'
> /Users/liuyanbo/git/avro/lang/c++/test/AvrogencppTests.cc:124:5:   required from 'void
checkRecord(const T1&, const T2&) [with T1 = testgen_r::RootRecord; T2 = testgen::RootRecord]'
> /Users/liuyanbo/git/avro/lang/c++/test/AvrogencppTests.cc:180:23:   required from here
> /Users/liuyanbo/Downloads/boost_1_56_0/boost/test/test_tools.hpp:536:17: warning: comparison
between 'const enum testgen_r::ExampleEnum' and 'const enum testgen::ExampleEnum' [-Wenum-compare]
>      return left == right;
>                  ^
> {quote}

This message was sent by Atlassian JIRA

View raw message