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

Colin Patrick McCabe commented on HADOOP-11547:
-----------------------------------------------

Thanks for looking at this.  You're certainly right that HADOOP-11403 regressed 
this on Windows.

I think the patch here is not quite right.  The code for UNIX uses a function 
defined in {{exception.h}}, {{terror}}.  That is why the {{#include}} was 
added.  Due to an obscure quirk in pre-standardization C / C++ that got 
grandfathered into the ANSI standard, you can call a function without actually 
defining what types it takes, and the compiler will "guess" about what types it 
takes (I think it defaults to assuming that it returns an int?)  While this may 
compile (with a warning), it is not correct.  It may lead to incorrect code 
being generated if the size of the return type is different than the size of an 
{{int}}... I think there are some issues with the arguments as well.

I think it's better to do like we do in {{libhdfs/exception.h}}, and simply 
have a macro that stubs out these declarations for Windows.

thanks

> hadoop-common native compilation fails on Windows due to missing support for 
> __attribute__ declaration.
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-11547
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11547
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-11547.001.patch, HADOOP-11547.002.patch
>
>
> HADOOP-11403 made a change to include exception.h in NativeIO.c.  This header 
> includes use of the non-standard gcc {{\_\_attribute\_\_}} declaration, and 
> thus fails compilation on Windows.



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

Reply via email to