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>)
# 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)
return NULL;
}
- char path_buf[path_length];
+ char* path_buf = (char*)alloca(path_length);
if (_NSGetExecutablePath(path_buf, &path_length) != 0)
{
errno = EINVAL;
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 )
{
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" );
#undef va_start
#undef va_end
#undef va_copy
+#undef va_arg
#undef stdin
#undef stdout
#undef stderr