Skip to content

Commit 72aba2b

Browse files
LazarTrsic-Imgldv-alt
authored andcommitted
Move is_negated_errno() to new header negated_errno.h
Move is_negated_errno() to a separate new header file negated_errno.h and include it just for architectures which require it. is_negated_errno() is not used on those architectures that have a dedicated register to signal a syscall error. The issue was raised when compiling with clang, which is more strict regarding semantics of unused static inline functions defined in C files and will issue a -Wunused-function warrning if they are not used anywhere. * syscall.c (is_negated_errno): Move to ... * negated_errno.h: ... new file. * Makefile.am (strace_SOURCES): Add it. * linux/aarch64/get_error.c: Include it. * linux/arc/get_error.c: Likewise. * linux/arm/get_error.c: Likewise. * linux/avr32/get_error.c: Likewise. * linux/bfin/get_error.c: Likewise. * linux/crisv10/get_error.c: Likewise. * linux/hppa/get_error.c: Likewise. * linux/i386/get_error.c: Likewise. * linux/ia64/get_error.c: Likewise. * linux/m68k/get_error.c: Likewise. * linux/metag/get_error.c: Likewise. * linux/microblaze/get_error.c: Likewise. * linux/or1k/get_error.c: Likewise. * linux/riscv/get_error.c: Likewise. * linux/s390/get_error.c: Likewise. * linux/sh/get_error.c: Likewise. * linux/sh64/get_error.c: Likewise. * linux/tile/get_error.c: Likewise. * linux/x86_64/get_error.c: Likewise. * linux/xtensa/get_error.c: Likewise.
1 parent eb4467d commit 72aba2b

File tree

23 files changed

+92
-20
lines changed

23 files changed

+92
-20
lines changed

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ strace_SOURCES = \
179179
msghdr.h \
180180
mtd.c \
181181
native_defs.h \
182+
negated_errno.h \
182183
net.c \
183184
netlink.c \
184185
netlink.h \

linux/aarch64/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
#define get_error arm_get_error
24
#include "arm/get_error.c"
35
#undef get_error

linux/arc/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/arm/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/avr32/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/bfin/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/crisv10/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/hppa/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/i386/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

linux/ia64/get_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "negated_errno.h"
2+
13
static void
24
get_error(struct tcb *tcp, const bool check_errno)
35
{

0 commit comments

Comments
 (0)