Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some clang-cl warnings regarding unused parameters #8

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions deps/base64/base64.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/ssse3/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_SSSE3=1' ],
'cflags_cpp': [],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these work? What are the fixed warnings?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without these, you are passing-std=c++17 to clang-cl when compiling C code. The better solution would be for the build engine to recognize that it is compiling C code, and not pass the C++ flags.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that it works because I don't see any occurence of cflags_cpp in the code base (including the source code of GYP)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. It should be cflags_cc.

'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mssse3' ],
Expand All @@ -102,6 +103,7 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/sse41/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_SSE41=1' ],
'cflags_cpp': [],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-msse4.1' ],
Expand All @@ -126,6 +128,7 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/sse42/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_SSE42=1' ],
'cflags_cpp': [],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-msse4.2' ],
Expand All @@ -150,9 +153,10 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/avx/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_AVX=1' ],
'cflags_cpp': [],
'cflags': [ '-mavx' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mavx' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mavx' ]
},
Expand All @@ -174,9 +178,10 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/avx2/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_AVX2=1' ],
'cflags_cpp': [],
'cflags': [ '-mavx2' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mavx2' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mavx2' ]
},
Expand All @@ -198,9 +203,10 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/avx512/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_AVX512=1' ],
'cflags_cpp': [],
'cflags': [ '-mavx512f', '-mavx512vl', '-mavx512vbmi' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mavx512vl', '-mavx512vbmi' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mavx512vl', '-mavx512vbmi' ]
},
Expand All @@ -222,6 +228,7 @@
'include_dirs': [ 'base64/include', 'base64/lib' ],
'sources': [ 'base64/lib/arch/neon32/codec.c' ],
'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_NEON32=1' ],
'cflags_cpp': [],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mfpu=neon' ],
Expand Down
3 changes: 2 additions & 1 deletion deps/base64/unofficial.gni
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ template("base64_gn_build") {
"-mavx512vbmi",
]
} else if (is_win) {
cflags_c = [ "/arch:AVX512" ]
cflags_c = [ "/arch:AVX512" ],
cflags_cpp = []
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions deps/cares/cares.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,14 @@
'-Wextra',
'-Wno-unused-parameter'
],
'cflags_cpp': [],
'defines': [ 'HAVE_CONFIG_H' ],
}],
[ 'OS not in "win android"', {
'cflags': [
'--std=gnu89'
],
'cflags_cpp': [],
}],
[ 'OS=="linux"', {
'include_dirs': [ 'config/linux' ],
Expand Down
1 change: 1 addition & 0 deletions deps/histogram/histogram.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'target_name': 'histogram',
'type': 'static_library',
'cflags': ['-fvisibility=hidden'],
'cflags_cpp': [],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
},
Expand Down
1 change: 1 addition & 0 deletions deps/openssl/openssl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
'includes': ['./openssl_common.gypi'],
'include_dirs+': ['openssl/apps/include'],
'cflags': [ '-fPIC' ],
'cflags_cpp': [],
#'ldflags': [ '-o', 'fips.so' ],
#'ldflags': [ '-Wl,--version-script=providers/fips.ld',],
'conditions': [
Expand Down
1 change: 1 addition & 0 deletions deps/openssl/openssl_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'cflags': [
'-W3', '-wd4090', '-Gs0', '-GF', '-Gy', '-nologo','/O2',
],
'cflags_cpp': [],
'msvs_disabled_warnings': [4090],
'link_settings': {
'libraries': [
Expand Down
6 changes: 5 additions & 1 deletion deps/zlib/zlib.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
'conditions': [
['target_arch in "ia32 x64" and OS!="ios"', {
'defines': [ 'ADLER32_SIMD_SSSE3' ],
'cflags': [ '-mssse3' ],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anonrig Would you happen to know why these variables (cflags, cflags_cpp) don't take hold here even though we are building under Windows with x64.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a GYP issue. It was never meant to support Clang on Windows AFAIK and cflags are passed differently for it. See c1d1878

'cflags_cpp': [],
'conditions': [
['OS=="win"', {
'defines': [ 'X86_WINDOWS' ],
},{
'defines': [ 'X86_NOT_WINDOWS' ],
}],
['OS!="win" or llvm_version!="0.0"', {
'cflags': [ '-mssse3' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mssse3' ],
},
Expand Down Expand Up @@ -62,6 +63,7 @@
{
'target_name': 'zlib_arm_crc32',
'type': 'static_library',
'cflags_cpp': [],
'conditions': [
['OS!="ios"', {
'conditions': [
Expand Down Expand Up @@ -174,6 +176,7 @@
{
'target_name': 'zlib',
'type': 'static_library',
'cflags_cpp': [],
'sources': [
'<!@pymod_do_main(GN-scraper "<(ZLIB_ROOT)/BUILD.gn" "\\"zlib\\".*?sources = ")',
],
Expand Down Expand Up @@ -250,6 +253,7 @@
{
'target_name': 'zlib',
'type': 'static_library',
'cflags_cpp': [],
'direct_dependent_settings': {
'defines': [
'USE_SYSTEM_ZLIB',
Expand Down