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

Eric Yang commented on HDFS-14394:
----------------------------------

[~stakiar]

If a small workaround can be applied without project refactoring effort, I 
think most people would prefer the work around.

In hadoop-hdfs-native-client project, there are c++ projects. The globally 
defined C_FLAGS will change all sub-projects to use gnu99 standard including 
libhdfspp project. Difference between c99 and gnu99 are gnu extensions that get 
compiled into the binary. This may subject the produced artifact to work with 
GPL license. I am not a lawyer, but I think this is not allowed in Apache 
projects.

I suggested to refactor the project setup with cmake-maven-plugins for two 
improvements.
 # User does not need to have cmake install in the local system. It will get 
downloaded as part of maven binary.
 # making sure that distinct C_FLAGS is not shared between projects of C or C++ 
languages.

Patch 001 didn't compile hadoop-hdfs-native-client  libhdfspp sub-project for 
me.

> Add -std=c99 / -std=gnu99 to libhdfs compile flags
> --------------------------------------------------
>
>                 Key: HDFS-14394
>                 URL: https://issues.apache.org/jira/browse/HDFS-14394
>             Project: Hadoop HDFS
>          Issue Type: Task
>          Components: hdfs-client, libhdfs, native
>            Reporter: Sahil Takiar
>            Assignee: Sahil Takiar
>            Priority: Major
>         Attachments: HDFS-14394.001.patch
>
>
> libhdfs compilation currently does not enforce a minimum required C version. 
> As of today, the libhdfs build on Hadoop QA works, but when built on a 
> machine with an outdated gcc / cc version where C89 is the default, 
> compilation fails due to errors such as:
> {code}
> /build/hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jclasses.c:106:5:
>  error: ‘for’ loop initial declarations are only allowed in C99 mode
> for (int i = 0; i < numCachedClasses; i++) {
> ^
> /build/hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jclasses.c:106:5:
>  note: use option -std=c99 or -std=gnu99 to compile your code
> {code}
> We should add the -std=c99 / -std=gnu99 flags to libhdfs compilation so that 
> we can enforce C99 as the minimum required version.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to