hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Clampffer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10554) libhdfs++: signed to unsigned conversions are breaking things and compiler isn't issuing expected warnings
Date Tue, 28 Jun 2016 20:43:57 GMT

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

James Clampffer commented on HDFS-10554:
----------------------------------------

Turns out we've been -slightly- very careless about implicit conversions that are technically
legal in c++.  Building with -Wsign-conversion shows that there's quite a bit of work to do
here.  Once the existing issues are fixed I think we should build with -Wsign-conversion by
default.

> libhdfs++: signed to unsigned conversions are breaking things and compiler isn't issuing
expected warnings
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-10554
>                 URL: https://issues.apache.org/jira/browse/HDFS-10554
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: James Clampffer
>            Assignee: James Clampffer
>
> There's at least two places where we use -1 to indicate unset/default values that end
up getting cast into unsigned integers.  The compiler should be smart enough to figure this
out and issue a warning but it's not; we need to find out what's going on there.  We also
need to fix the places where this sort of thing has found its way into the code:
> In URI
> {code}
>       // -1 if the port is undefined.
>       optional<uint16_t> get_port() const
>       { return port; }
> {code}
> In Options (gets cast to uint64_t somewhere)
> {code}
>     /**
>      * Maximum number of retries for RPC operations
>      **/
>     int max_rpc_retries;
>     static const int kNoRetry = -1;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message