Michael Poole created ORC-579:
---------------------------------

             Summary: Compilation fails with g++ 9
                 Key: ORC-579
                 URL: https://issues.apache.org/jira/browse/ORC-579
             Project: ORC
          Issue Type: Improvement
          Components: C++
    Affects Versions: 1.6.2, 1.5.8
         Environment: Ubuntu 19.10
            Reporter: Michael Poole


g++ 9.2.1 with glibc 2.30 generates several warnings like these, which are 
promoted to compilation errors:

 
{code:java}
In file included from /usr/include/string.h:494,
                 from 
c++/libs/thirdparty/protobuf_ep-install/include/google/protobuf/stubs/port.h:38,
                 from 
c++/libs/thirdparty/protobuf_ep-install/include/google/protobuf/stubs/common.h:45,
                 from c++/src/orc_proto.pb.h:9,
                 from c++/src/orc_proto.pb.cc:4,
                 from ../c++/src/wrap/orc-proto-wrapper.cc:44:
In function ‘void* memset(void*, int, size_t)’,
    inlined from ‘void orc::proto::FileTail::SharedCtor()’ at 
c++/src/orc_proto.pb.cc:13453:11,
    inlined from ‘orc::proto::FileTail::FileTail()’ at 
c++/src/orc_proto.pb.cc:13426:13,
    inlined from ‘void 
protobuf_orc_5fproto_2eproto::InitDefaultsFileTailImpl()’ at 
c++/src/orc_proto.pb.cc:13421:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:33: error: ‘void* 
__builtin_memset(void*, int, long unsigned int)’ offset [33, 56] from the 
object at ‘orc::proto::_FileTail_default_instance_’ is out of the bounds of 
referenced subobject ‘orc::proto::FileTail::postscript_’ with type 
‘orc::proto::PostScript*’ at offset 24 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{code}
This can be resolved by adding a line to the obvious place in 
c++/src/wrap/orc-proto-wrapper.cc:

 
{code:java}
  DIAGNOSTIC_IGNORE("-Warray-bounds")
{code}
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to