Skip to content

Commit d4bf78b

Browse files
dance858claude
andcommitted
Silence Apple Accelerate header warnings via system_header pragma
Apple's Accelerate/LAPACK/Sparse headers (pulled in through ACCELERATE_NEW_LAPACK) trip a large, SDK-version-dependent set of -Wpedantic/GNU-extension warnings: _Nullable/_Nonnull nullability qualifiers, zero-arg variadic macros, extra semicolons, and more. On the Xcode SDK this floods the build with tens of thousands of warnings from headers we cannot fix. Mark the Accelerate include as a system header with `#pragma clang system_header` so all of its warnings are suppressed regardless of which flag or SDK version produces them, while our own code keeps full -Wpedantic strictness. cblas_wrapper.h contains nothing but the include, so the marker is effectively scoped to Accelerate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7e7678e commit d4bf78b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

include/utils/cblas_wrapper.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020

2121
#ifdef __APPLE__
2222
#define ACCELERATE_NEW_LAPACK
23+
/* Apple's Accelerate/LAPACK/Sparse headers trip a large, SDK-dependent set
24+
* of -Wpedantic/GNU-extension warnings (nullability qualifiers, zero-arg
25+
* variadic macros, etc.) that we cannot fix and do not want in our build
26+
* output. Treat everything included below as a system header so all of its
27+
* warnings are suppressed, while our own code keeps full -Wpedantic
28+
* strictness. This file contains nothing but the include, so the marker is
29+
* effectively scoped to Accelerate. */
30+
#pragma clang system_header
2331
#include <Accelerate/Accelerate.h>
2432
#else
2533
#include <cblas.h>

0 commit comments

Comments
 (0)