[ 
https://issues.apache.org/jira/browse/HDFS-12276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16118479#comment-16118479
 ] 

James Clampffer commented on HDFS-12276:
----------------------------------------

Nice catch [~anatoli.shein].  It should be sufficient to just add a virtual 
destructor and define it in one of the .cc files to force a vtable to be 
instantiated in a single compilation unit.  The linker will generally be smart 
enough to fix this in the same way it can fold generated code for "inline" 
qualified functions together as an optimization pass but I don't know if clang 
does by default.

I think there's a couple ways to prevent, or at least deal with, these issues 
in the future:
-Find a covering set of all the warnings used by Hadoop related projects like 
orc, parquet, and arrow (and plenty of others).  Then use them in this library. 
 This is always going to be a step behind of anything being added to those 
libraries.
-You can always switch back to a more permissive build for third-party libs for 
other projects.  That's the approach we've taken with the things libhdfs++ 
depends on; this isn't really a bug in the library as much as it's a difference 
in how permissive the build should be.

> libhdfs++: uri parser has clang warnings that break external projects
> ---------------------------------------------------------------------
>
>                 Key: HDFS-12276
>                 URL: https://issues.apache.org/jira/browse/HDFS-12276
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: Anatoli Shein
>
> When trying to do a clang build of libhdfs++ as part of the ORC project I get 
> some warnings that are treated as errors:
> In file included from 
> /home/travis/build/apache/orc/c++/libs/libhdfspp/include/hdfspp/options.h:21:
> /home/travis/build/apache/orc/c++/libs/libhdfspp/include/hdfspp/uri.h:30:7: 
> error: 'uri_parse_error' has no out-of-line virtual method definitions; its 
> vtable will be emitted in every translation unit [-Werror,-Wweak-vtables]
> class uri_parse_error : public std::invalid_argument {
>       ^
> 2 errors generated.
> These should be fixed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to