History

powerpc: Make setjmp/longjmp signature standard

Declaring setjmp()/longjmp() as taking longs makes the signature non-standard, and makes clang complain. In the past, this has been worked around by adding -ffreestanding to the compile flags. The implementation looks like it only ever propagates the value (in longjmp) or sets it to 1 (in setjmp), and we only call longjmp with integer parameters. This allows removing -ffreestanding from the compilation flags.

Clement Courbet committed 6 years ago

Commit c17eb4d1 parent 41b84263 files · +4 −8Browse files

Unified · Split

3 files
  1. arch/powerpc/include/asm/setjmp.h +4 −2
  2. arch/powerpc/kexec/Makefile +0 −3
  3. arch/powerpc/xmon/Makefile +0 −3
arch/powerpc/include/asm/setjmp.h+4−2
@@ -7,7 +7,9 @@ · 6 unmodified lines
7 7
8#define JMP_BUF_LEN 238#define JMP_BUF_LEN 23
9 9
10extern long setjmp(long *) __attribute__((returns_twice));10typedef long jmp_buf[JMP_BUF_LEN];
11extern void longjmp(long *, long) __attribute__((noreturn));11
12extern int setjmp(jmp_buf env) __attribute__((returns_twice));
13extern void longjmp(jmp_buf env, int val) __attribute__((noreturn));
12 14
13#endif /* _ASM_POWERPC_SETJMP_H */15#endif /* _ASM_POWERPC_SETJMP_H */
arch/powerpc/kexec/Makefile+0−3
@@ -3,9 +3,6 @@ · 2 unmodified lines
3# Makefile for the linux kernel.3# Makefile for the linux kernel.
4#4#
5 5
6# Avoid clang warnings around longjmp/setjmp declarations
7CFLAGS_crash.o += -ffreestanding
8
9obj-y += core.o crash.o core_$(BITS).o6obj-y += core.o crash.o core_$(BITS).o
10 7
11obj-$(CONFIG_PPC32) += relocate_32.o8obj-$(CONFIG_PPC32) += relocate_32.o
arch/powerpc/xmon/Makefile+0−3
@@ -1,9 +1,6 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2# Makefile for xmon2# Makefile for xmon
3 3
4# Avoid clang warnings around longjmp/setjmp declarations
5subdir-ccflags-y := -ffreestanding
6
7GCOV_PROFILE := n4GCOV_PROFILE := n
8KCOV_INSTRUMENT := n5KCOV_INSTRUMENT := n
9UBSAN_SANITIZE := n6UBSAN_SANITIZE := n

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t