Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warning on aarch64-linux #56480

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Nov 6, 2024

This fixes the warning:

/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c: In function 'jl_simulate_longjmp':
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c:995:22: warning: initialization of 'mcontext_t *' {aka 'struct sigcontext *'} from incompatible pointer type 'struct unw_sigcontext *' [-Wincompatible-pointer-types]
  995 |     mcontext_t *mc = &c->uc_mcontext;
      |                      ^

This is the last remaining warning during compilation on aarch64-linux.

@giordano giordano added the system:arm ARMv7 and AArch64 label Nov 6, 2024
@giordano giordano requested a review from vtjnash November 6, 2024 23:26
@giordano
Copy link
Contributor Author

giordano commented Nov 6, 2024

I was kind of hoping this could be related to #54839, but based on local testing that issue still remains after this change. Addressing a compilation warning seems worthwhile anyway though.

@giordano
Copy link
Contributor Author

giordano commented Nov 6, 2024

BTW, GCC 14 no longer allows implicitly casting all pointer types to all other pointer types, promoting the above warning to an error (ref: #54310 (comment)), so fixing this issue one way or another is rather important.

Copy link
Member

@topolarity topolarity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember ARMv7 having a similar issue - is it really just AArch64?

@giordano
Copy link
Contributor Author

giordano commented Nov 7, 2024

I remember ARMv7 having a similar issue - is it really just AArch64?

The code referred to in the comments in only in aarch64. I don't have direct experience with compiling for armv{6,7}l, so I don't know what are the warnings there.

Side note, I just noticed there's a redundant defined(_OS_LINUX_) guard in my code, I'll remove that.

This fixes the warning:
```
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c: In function 'jl_simulate_longjmp':
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c:995:22: warning: initialization of 'mcontext_t *' {aka 'struct sigcontext *'} from incompatible pointer type 'struct unw_sigcontext *' [-Wincompatible-pointer-types]
  995 |     mcontext_t *mc = &c->uc_mcontext;
      |                      ^
```
@topolarity
Copy link
Member

I remember ARMv7 having a similar issue - is it really just AArch64?

The code referred to in the comments in only in aarch64.

Ah you're right - I was thinking about this piece: https://github.com/libunwind/libunwind/blob/e63e024b72d35d4404018fde1a546fde976da5c5/include/libunwind-arm.h#L261-L269

Orthogonal to this PR, in any case 🙂

giordano added a commit to giordano/julia-buildkite that referenced this pull request Nov 7, 2024
With JuliaLang/julia#45729 and
JuliaLang/julia#56480 we cleared all the warnings
appearing while compiling Julia on this platform, so we can enforce `-Werror` on
CI now.
@giordano giordano merged commit 8593792 into master Nov 7, 2024
7 checks passed
@giordano giordano deleted the mg/aarch64-warning-stackwalk branch November 7, 2024 19:11
giordano added a commit to JuliaCI/julia-buildkite that referenced this pull request Nov 8, 2024
With JuliaLang/julia#45729 and
JuliaLang/julia#56480 we cleared all the warnings
appearing while compiling Julia on this platform, so we can enforce `-Werror` on
CI now.
giordano added a commit that referenced this pull request Nov 10, 2024
This fixes the warning:
```
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c: In function 'jl_simulate_longjmp':
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c:995:22: warning: initialization of 'mcontext_t *' {aka 'struct sigcontext *'} from incompatible pointer type 'struct unw_sigcontext *' [-Wincompatible-pointer-types]
  995 |     mcontext_t *mc = &c->uc_mcontext;
      |                      ^
```

This is the last remaining warning during compilation on aarch64-linux.

(cherry picked from commit 8593792)
giordano added a commit that referenced this pull request Nov 10, 2024
This fixes the warning:
```
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c: In function 'jl_simulate_longjmp':
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c:995:22: warning: initialization of 'mcontext_t *' {aka 'struct sigcontext *'} from incompatible pointer type 'struct unw_sigcontext *' [-Wincompatible-pointer-types]
  995 |     mcontext_t *mc = &c->uc_mcontext;
      |                      ^
```

This is the last remaining warning during compilation on aarch64-linux.

(cherry picked from commit 8593792)
N5N3 pushed a commit that referenced this pull request Nov 11, 2024
This fixes the warning:
```
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c: In function 'jl_simulate_longjmp':
/cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c:995:22: warning: initialization of 'mcontext_t *' {aka 'struct sigcontext *'} from incompatible pointer type 'struct unw_sigcontext *' [-Wincompatible-pointer-types]
  995 |     mcontext_t *mc = &c->uc_mcontext;
      |                      ^
```

This is the last remaining warning during compilation on aarch64-linux.

(cherry picked from commit 8593792)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:arm ARMv7 and AArch64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants