[ 
https://issues.apache.org/jira/browse/HADOOP-10810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Nauroth updated HADOOP-10810:
-----------------------------------

    Attachment: HADOOP-10810.1.patch

This patch cleans up the compilation warnings on both Linux and Windows.  For 
reference, I've pasted the compilation warnings I was seeing from both 
platforms below.  Most of these were innocuous.  I think the only one that had 
the potential to cause real problems was in {{JniBasedUnixGroupsMappingWin}}, 
where we could have written an error message to the wrong memory address.

This patch does not clean up the warnings in lz4.h on Windows.  I think the 
right answer on that one is to refresh our copy of the lz4 code from upstream.  
This warning was already fixed in the latest lz4 code.  I'd prefer to track 
updating lz4 in a separate issue instead of combining it into this patch.

Linux:
{code}
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zlib/ZlibCompressor.c:393:1:
 warning: control reaches end of non-void function [-Wreturn-type]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c:951:3:
 warning: return makes integer from pointer without a cast [enabled by default]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c:986:3:
 warning: return makes integer from pointer without a cast [enabled by default]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c:659:3:
 warning: ‘jstr_username’ may be used uninitialized in this function 
[-Wuninitialized]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c:658:27:
 warning: ‘pw_buf’ may be used uninitialized in this function [-Wuninitialized]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c:781:3:
 warning: ‘jstr_groupname’ may be used uninitialized in this function 
[-Wuninitialized]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c:780:27:
 warning: ‘pw_buf’ may be used uninitialized in this function [-Wuninitialized]
     [exec] 
/mnt/data/cnauroth/git/hadoop-common/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocketWatcher.c:142:20:
 warning: ‘pollfd’ may be used uninitialized in this function [-Wuninitialized]
{code}

Windows:
{code}
  
c:\hdc\hadoop-common-project\hadoop-common\src\main\native\src\org\apache\hadoop\io\compress\lz4\lz4.h(59):
 warning C4005: 'inline' : macro redefinition 
[C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
  
c:\hdc\hadoop-common-project\hadoop-common\src\main\native\src\org\apache\hadoop\io\compress\lz4\lz4.h(59):
 warning C4005: 'inline' : macro redefinition 
[C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
  src\org\apache\hadoop\io\nativeio\NativeIO.c(693): warning C4047: 'return' : 
'jlong' differs in levels of indirection from 'void *' 
[C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
  src\org\apache\hadoop\io\nativeio\NativeIO.c(713): warning C4098: 
'Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_munmap' : 'void' 
function returning a value 
[C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
  src\org\apache\hadoop\security\JniBasedUnixGroupsMappingWin.c(48): warning 
C4047: 'function' : 'LPSTR' differs in levels of indirection from 'LPSTR *' 
[C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
  src\org\apache\hadoop\security\JniBasedUnixGroupsMappingWin.c(48): warning 
C4024: 'FormatMessageA' : different types for formal and actual parameter 5 
[C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
{code}


> Clean up native code compilation warnings.
> ------------------------------------------
>
>                 Key: HADOOP-10810
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10810
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>    Affects Versions: 3.0.0, 2.5.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>            Priority: Minor
>         Attachments: HADOOP-10810.1.patch
>
>
> There are several compilation warnings coming from the native code on both 
> Linux and Windows.



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

Reply via email to