Gautham Banasandra created HDFS-16681:
-----------------------------------------

             Summary: Do not pass GCC flags for MSVC
                 Key: HDFS-16681
                 URL: https://issues.apache.org/jira/browse/HDFS-16681
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: libhdfs++
    Affects Versions: 3.4.0
         Environment: Windows 10
            Reporter: Gautham Banasandra
            Assignee: Gautham Banasandra


The tests in HDFS native client uses the *-Wno-missing-field-initializers* flag 
to ignore warnings about uninitialized members - 
https://github.com/apache/hadoop/blob/8f83d9f56d775c73af6e3fa1d6a9aa3e64eebc37/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/CMakeLists.txt#L27-L28
{code}
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers")
{code}

This leads to the following error on Visual C++.
{code}
     [exec] 
"E:\hadoop-hdfs-project\hadoop-hdfs-native-client\target\native\ALL_BUILD.vcxproj"
 (default target) (1) ->
     [exec] 
"E:\hadoop-hdfs-project\hadoop-hdfs-native-client\target\native\main\native\libhdfspp\tests\x-platform\x_platform_dirent_test_obj.vcxproj"
 (default target) (24) ->
     [exec]   cl : command line error D8021: invalid numeric argument 
'/Wno-missing-field-initializers' 
[E:\hadoop-hdfs-project\hadoop-hdfs-native-client\target\native\main\native\libhdfspp\tests\x-platform\x_platform_dirent_test_obj.vcxproj]
{code}

Thus, we need to pass these flags only when the compiler isn't Visual C++.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to