summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungju Lee <leee.lee@samsung.com>2024-06-10 20:13:26 +0900
committer이형주/MDE Lab(SR)/삼성전자 <leee.lee@samsung.com>2024-06-10 20:19:07 +0900
commit09a6f2a6f1e7e18fe7e32a7fd9d396afe32965ed (patch)
tree094f107a65b0a051f289456dd94ce00c6ad9551f
parentf74b85bdabf575b0d8884b798b001fbd3d104f1e (diff)
downloaddiagnostics-accepted/tizen_unified_toolchain.tar.gz
diagnostics-accepted/tizen_unified_toolchain.tar.bz2
diagnostics-accepted/tizen_unified_toolchain.zip
-rw-r--r--eng/native/configurecompiler.cmake8
-rw-r--r--src/shared/minipal/getexepath.h2
-rw-r--r--src/shared/pal/src/file/path.cpp6
-rw-r--r--src/shared/pal/src/include/pal/palinternal.h1
4 files changed, 13 insertions, 4 deletions
diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake
index 0be4937c7..e4d96c1e6 100644
--- a/eng/native/configurecompiler.cmake
+++ b/eng/native/configurecompiler.cmake
@@ -549,6 +549,11 @@ if (CLR_CMAKE_HOST_UNIX)
add_compile_options(-Wimplicit-fallthrough)
endif()
+ # VLAs are non standard in C++, aren't available on Windows and
+ # are a warning by default since clang 18.
+ # For consistency, enable warnings for all compiler versions.
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wvla>)
+
#These seem to indicate real issues
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)
@@ -591,6 +596,9 @@ if (CLR_CMAKE_HOST_UNIX)
# other clang 16.0 suppressions
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
add_compile_options(-Wno-cast-function-type-strict)
+
+ # clang 18.1 supressions
+ add_compile_options(-Wno-switch-default)
else()
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)
diff --git a/src/shared/minipal/getexepath.h b/src/shared/minipal/getexepath.h
index a5e12e08a..3c9ad5368 100644
--- a/src/shared/minipal/getexepath.h
+++ b/src/shared/minipal/getexepath.h
@@ -37,7 +37,7 @@ static inline char* minipal_getexepath(void)
return NULL;
}
- char path_buf[path_length];
+ char* path_buf = (char*)alloca(path_length);
if (_NSGetExecutablePath(path_buf, &path_length) != 0)
{
errno = EINVAL;
diff --git a/src/shared/pal/src/file/path.cpp b/src/shared/pal/src/file/path.cpp
index edc9c6c0a..469756e6c 100644
--- a/src/shared/pal/src/file/path.cpp
+++ b/src/shared/pal/src/file/path.cpp
@@ -401,8 +401,8 @@ GetTempPathW(
return 0;
}
- char TempBuffer[nBufferLength > 0 ? nBufferLength : 1];
- DWORD dwRetVal = GetTempPathA( nBufferLength, TempBuffer );
+ char* tempBuffer = (char*)alloca(nBufferLength > 0 ? nBufferLength : 1);
+ DWORD dwRetVal = GetTempPathA( nBufferLength, tempBuffer );
if ( dwRetVal >= nBufferLength )
{
@@ -413,7 +413,7 @@ GetTempPathW(
else if ( dwRetVal != 0 )
{
/* Convert to wide. */
- if ( 0 == MultiByteToWideChar( CP_ACP, 0, TempBuffer, -1,
+ if ( 0 == MultiByteToWideChar( CP_ACP, 0, tempBuffer, -1,
lpBuffer, dwRetVal + 1 ) )
{
ASSERT( "An error occurred while converting the string to wide.\n" );
diff --git a/src/shared/pal/src/include/pal/palinternal.h b/src/shared/pal/src/include/pal/palinternal.h
index 6b2622455..0078c1c44 100644
--- a/src/shared/pal/src/include/pal/palinternal.h
+++ b/src/shared/pal/src/include/pal/palinternal.h
@@ -431,6 +431,7 @@ function_name() to call the system's implementation
#undef va_start
#undef va_end
#undef va_copy
+#undef va_arg
#undef stdin
#undef stdout
#undef stderr