Skip to content

Fix compilation with xcode 16.3#205

Merged
szegedi merged 1 commit into
mainfrom
nsavoire/fix_compilation_with_xcode_16.3
May 2, 2025
Merged

Fix compilation with xcode 16.3#205
szegedi merged 1 commit into
mainfrom
nsavoire/fix_compilation_with_xcode_16.3

Conversation

@nsavoire
Copy link
Copy Markdown

What does this PR do?:

xcode 16.3 ships with clang17 as default compiler. This version of clang warns about casts between incompatible function types, and nan does some of them:

include/node/v8-persistent-handle.h:512:26: error: cast from 'typename WeakCallbackInfo<ObjectWrap>::Callback' (aka 'void (*)(const WeakCallbackInfo<ObjectWrap> &)') to 'Callback' (aka 'void (*)(const WeakCallbackInfo<void> &)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]

This commit adds a -Wno-cast-function-type-mismatch flag to the compiler flags to suppress these warnings (that would otherwise cause errors because of the -Werror flag).

@nsavoire nsavoire requested a review from szegedi as a code owner April 17, 2025 15:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 2025

Overall package size

Self size: 9.54 MB
Deduped: 9.91 MB
No deduping: 9.91 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | source-map | 0.7.4 | 226 kB | 226 kB | | pprof-format | 2.1.0 | 111.69 kB | 111.69 kB | | p-limit | 3.1.0 | 7.75 kB | 13.78 kB | | delay | 5.0.0 | 11.17 kB | 11.17 kB | | node-gyp-build | 3.9.0 | 8.81 kB | 8.81 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@nsavoire nsavoire added the semver-patch Bug or security fixes, mainly label Apr 17, 2025
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 17, 2025

Benchmarks

Benchmark execution time: 2025-04-17 16:19:56

Comparing candidate commit 56e3db0 in PR branch nsavoire/fix_compilation_with_xcode_16.3 with baseline commit f972f10 in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 94 metrics, 25 unstable metrics.

scenario:profiler-idle-with-wall-profiler-18

  • 🟩 cpu_user_time [-9.564ms; -2.909ms] or [-13.639%; -4.149%]

xcode 16.3 ships with clang17 as default compiler.
This version of clang warns about casts between incompatible function types,
and v8 has some of those:
```
include/node/v8-persistent-handle.h:512:26: error: cast from 'typename WeakCallbackInfo<ObjectWrap>::Callback' (aka 'void (*)(const WeakCallbackInfo<ObjectWrap> &)') to 'Callback' (aka 'void (*)(const WeakCallbackInfo<void> &)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
```

This commit adds a -Wno-cast-function-type-mismatch flag to the compiler
flags to suppress these warnings (that would otherwise cause errors because
of the -Werror flag) and also a -Wno-unknown-warning-option flag to suppress
the warning about the unknown warning option "-Wcast-function-type-mismatch"
for clang < 17.
@nsavoire nsavoire force-pushed the nsavoire/fix_compilation_with_xcode_16.3 branch from b58dd3e to 56e3db0 Compare April 17, 2025 16:15
@szegedi szegedi merged commit d5a5e59 into main May 2, 2025
63 checks passed
@szegedi szegedi deleted the nsavoire/fix_compilation_with_xcode_16.3 branch May 2, 2025 12:57
szegedi pushed a commit that referenced this pull request May 8, 2025
xcode 16.3 ships with clang17 as default compiler.
This version of clang warns about casts between incompatible function types,
and v8 has some of those:
```
include/node/v8-persistent-handle.h:512:26: error: cast from 'typename WeakCallbackInfo<ObjectWrap>::Callback' (aka 'void (*)(const WeakCallbackInfo<ObjectWrap> &)') to 'Callback' (aka 'void (*)(const WeakCallbackInfo<void> &)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
```

This commit adds a -Wno-cast-function-type-mismatch flag to the compiler
flags to suppress these warnings (that would otherwise cause errors because
of the -Werror flag) and also a -Wno-unknown-warning-option flag to suppress
the warning about the unknown warning option "-Wcast-function-type-mismatch"
for clang < 17.
@szegedi szegedi mentioned this pull request May 8, 2025
nsavoire added a commit that referenced this pull request May 10, 2025
xcode 16.3 ships with clang17 as default compiler.
This version of clang warns about casts between incompatible function types,
and v8 has some of those:
```
include/node/v8-persistent-handle.h:512:26: error: cast from 'typename WeakCallbackInfo<ObjectWrap>::Callback' (aka 'void (*)(const WeakCallbackInfo<ObjectWrap> &)') to 'Callback' (aka 'void (*)(const WeakCallbackInfo<void> &)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
```

This commit adds a -Wno-cast-function-type-mismatch flag to the compiler
flags to suppress these warnings (that would otherwise cause errors because
of the -Werror flag) and also a -Wno-unknown-warning-option flag to suppress
the warning about the unknown warning option "-Wcast-function-type-mismatch"
for clang < 17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Bug or security fixes, mainly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants