Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14394

Add -std=c99 / -std=gnu99 to libhdfs compile flags

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0, 3.2.2
    • Component/s: hdfs-client, libhdfs, native
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      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:

      /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
      

      We should add the -std=c99 / -std=gnu99 flags to libhdfs compilation so that we can enforce C99 as the minimum required version.

        Attachments

        1. HDFS-14394.001.patch
          1 kB
          Sahil Takiar

          Issue Links

            Activity

              People

              • Assignee:
                stakiar Sahil Takiar
                Reporter:
                stakiar Sahil Takiar
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: