Skip to content

Commit 4155275

Browse files
committed
Suppress clang-16 warnings (#81573)
1 parent c2d6594 commit 4155275

File tree

7 files changed

+32
-11
lines changed

7 files changed

+32
-11
lines changed

eng/common/native/init-compiler.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if [[ -z "$CLR_CC" ]]; then
7171
# Set default versions
7272
if [[ -z "$majorVersion" ]]; then
7373
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
74-
if [[ "$compiler" == "clang" ]]; then versions=( 15 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
74+
if [[ "$compiler" == "clang" ]]; then versions=( 16 15 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
7575
elif [[ "$compiler" == "gcc" ]]; then versions=( 12 11 10 9 8 7 6 5 4.9 ); fi
7676

7777
for version in "${versions[@]}"; do

eng/native/configurecompiler.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,15 @@ if (CLR_CMAKE_HOST_UNIX)
447447
add_compile_options(-Wno-incompatible-ms-struct)
448448

449449
add_compile_options(-Wno-reserved-identifier)
450+
451+
# clang 16.0 introduced buffer hardening https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
452+
# which we are not conforming to yet.
453+
add_compile_options(-Wno-unsafe-buffer-usage)
454+
455+
# other clang 16.0 suppressions
456+
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
457+
add_compile_options(-Wno-cast-function-type-strict)
458+
add_compile_options(-Wno-incompatible-function-pointer-types-strict)
450459
else()
451460
add_compile_options(-Wno-uninitialized)
452461
add_compile_options(-Wno-strict-aliasing)

src/coreclr/dlls/mscordbi/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ elseif(CLR_CMAKE_HOST_UNIX)
100100
mscordaccore
101101
)
102102

103-
# COREDBI_LIBRARIES is mentioned twice because ld is one pass linker and will not find symbols
104-
# if they are defined after they are used. Having all libs twice makes sure that ld will actually
105-
# find all symbols.
106-
target_link_libraries(mscordbi ${COREDBI_LIBRARIES} ${COREDBI_LIBRARIES})
103+
target_link_libraries(mscordbi ${COREDBI_LIBRARIES})
107104

108105
add_dependencies(mscordbi mscordaccore)
109106

src/coreclr/dlls/mscordbi/mscordbi.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,18 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
3232
// Defer to the main debugging code.
3333
return DbgDllMain(hInstance, dwReason, lpReserved);
3434
}
35+
36+
#if defined(HOST_LINUX) && defined(TARGET_LINUX)
37+
PALIMPORT HINSTANCE PALAPI DAC_PAL_RegisterModule(IN LPCSTR lpLibFileName);
38+
PALIMPORT VOID PALAPI DAC_PAL_UnregisterModule(IN HINSTANCE hInstance);
39+
40+
HINSTANCE PALAPI PAL_RegisterModule(IN LPCSTR lpLibFileName)
41+
{
42+
return DAC_PAL_RegisterModule(lpLibFileName);
43+
}
44+
45+
VOID PALAPI PAL_UnregisterModule(IN HINSTANCE hInstance)
46+
{
47+
DAC_PAL_UnregisterModule(hInstance);
48+
}
49+
#endif

src/native/corehost/apphost/static/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ if(CLR_CMAKE_TARGET_WIN32)
6565
add_linker_flag("/DEF:${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost.def")
6666

6767
else()
68-
if(CLR_CMAKE_TARGET_OSX)
69-
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_OSXexports.src)
68+
if(CLR_CMAKE_TARGET_FREEBSD)
69+
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_freebsdexports.src)
7070
else()
7171
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_unixexports.src)
7272
endif()

src/native/corehost/apphost/static/singlefilehost_OSXexports.src renamed to src/native/corehost/apphost/static/singlefilehost_freebsdexports.src

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ g_dacTable
99

1010
; Used by profilers
1111
MetaDataGetDispenser
12+
13+
; FreeBSD needs to reexport these
14+
__progname
15+
environ

src/native/corehost/apphost/static/singlefilehost_unixexports.src

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ g_dacTable
99

1010
; Used by profilers
1111
MetaDataGetDispenser
12-
13-
; FreeBSD needs to reexport these
14-
__progname
15-
environ

0 commit comments

Comments
 (0)