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

Sahil Takiar commented on HDFS-14394:
-------------------------------------

[~eyang] do those tests pass locally on trunk without the patch posted here? 
I've seen some errors like that before and it usually is environmental. Hadoop 
QA was able to build the patch, but I don't think it ran the libhdfs++ tests.

I'm not sure I understand that link, but I don't think adding {{-std=c99}} to 
{{CMAKE_C_FLAGS}} forces all libhdfs++ code to be compiled using C99. My 
understanding is that {{CMAKE_C_FLAGS}} is for compiling C files and 
{{CMAKE_CXX_FLAGS}} is for compiling C++ files. The libhdfs++ CMake file 
already includes {{-std=c++11}}. There are a few of C files in libhdfs++, but 
most seem to be testing related.

> 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