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

Manu Zhang commented on MAPREDUCE-5977:
---------------------------------------

Hi Todd, I'd like to have a try with this jira.
Please note that *the attached patch doesn't handle all the issues*. I post it 
here for your opinion over those I'm not sure or feel uncomfortable.

Here are they: 
1. I used static_cast when it's safe to cast a int to unsigned int. (should we 
use c-style cast instead ?)
2. I included <inttypes.h> and replaced "llu" with the macro PRIu64 which could 
resolve to long long unsigned int or long unsigned int dependant on platforms . 
Same for "lld" and PRId64. The only exception is 

{code:c++}
string StringUtil::ToString(int64_t v, char pad, int64_t len) {
  char tmp[32];
  snprintf(tmp, 32, "%%%c%lldlld", pad, static_cast<long long int>(len));
  return Format(tmp, static_cast<long long int>(v));
}
{code}

where it looks impossible to do so. 
3. I've left out warnings like
{code}  
warning: dereferencing type-punned pointer will break strict-aliasing rules 
[-Wstrict-aliasing]
   [exec]    return *(float*)&ret;
{code}
where I have not found a safe way to cast. 
4. I've left out  unused-result warnings. 
5. I've left out warnings generated by gtest.
  

> Fix or suppress native-task gcc warnings
> ----------------------------------------
>
>                 Key: MAPREDUCE-5977
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5977
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>          Components: task
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>         Attachments: mapreduce-5977.txt
>
>
> Currently, building the native task code on gcc 4.8 has a fair number of 
> warnings. We should fix or suppress them so that new warnings are easier to 
> see.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to