Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2ACB11735A for ; Wed, 4 Feb 2015 18:33:34 +0000 (UTC) Received: (qmail 24087 invoked by uid 500); 4 Feb 2015 18:33:35 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 24034 invoked by uid 500); 4 Feb 2015 18:33:35 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 24022 invoked by uid 99); 4 Feb 2015 18:33:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2015 18:33:34 +0000 Date: Wed, 4 Feb 2015 18:33:34 +0000 (UTC) From: "Colin Patrick McCabe (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-11547) hadoop-common native compilation fails on Windows due to missing support for __attribute__ declaration. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)