Skip to content

Commit 040c59f

Browse files
committed
chore(utils): add pointer casts to avoid C++ permissive mode
Signed-off-by: Alex Fabijanic <[email protected]>
1 parent 03fccbb commit 040c59f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cfg.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ local-checks-to-skip = \
1414
sc_prohibit_intprops_without_use \
1515
sc_error_message_uppercase \
1616
sc_GPL_version \
17-
sc_prohibit_atoi_atof
17+
sc_prohibit_atoi_atof \
18+
sc_cast_of_x_alloc_return_value
1819

1920

2021
#SHELL=bash -x

src/libcrun/utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ cleanup_filep (FILE **f)
9999
static inline void
100100
cleanup_closep (void *p)
101101
{
102-
int *pp = p;
102+
int *pp = (int *) p;
103103
if (*pp >= 0)
104104
TEMP_FAILURE_RETRY (close (*pp));
105105
}
106106

107107
static inline void
108108
cleanup_pidp (void *p)
109109
{
110-
pid_t *pp = p;
110+
pid_t *pp = (pid_t *) p;
111111
if (*pp > 0)
112112
{
113113
TEMP_FAILURE_RETRY (kill (*pp, SIGKILL));
@@ -127,7 +127,7 @@ make_libcrun_fd_map (size_t len)
127127
struct libcrun_fd_map *ret;
128128
size_t i;
129129

130-
ret = xmalloc (sizeof (*ret) + sizeof (int) * len);
130+
ret = (struct libcrun_fd_map *) xmalloc (sizeof (*ret) + sizeof (int) * len);
131131
ret->nfds = len;
132132
for (i = 0; i < len; i++)
133133
ret->fds[i] = -1;

0 commit comments

Comments
 (0)