Skip to content

posix: mqueue: pop mode as int with va_arg() #67071

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions lib/posix/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ static int receive_message(mqueue_desc *mqd, char *msg_ptr, size_t msg_len,
k_timeout_t timeout);
static void remove_mq(mqueue_object *msg_queue);

#if defined(__sparc__)
/*
* mode_t is defined as "unsigned short" on SPARC newlib. This type is promoted
* to "int" when passed through '...' so we should pass the promoted type to
* va_arg().
*/
#define PROMOTED_MODE_T int
#else
#define PROMOTED_MODE_T mode_t
#endif

/**
* @brief Open a message queue.
*
Expand All @@ -69,7 +58,8 @@ mqd_t mq_open(const char *name, int oflags, ...)

va_start(va, oflags);
if ((oflags & O_CREAT) != 0) {
mode = va_arg(va, PROMOTED_MODE_T);
BUILD_ASSERT(sizeof(mode_t) <= sizeof(int));
mode = va_arg(va, unsigned int);
attrs = va_arg(va, struct mq_attr*);
}
va_end(va);
Expand Down
3 changes: 0 additions & 3 deletions tests/posix/common/testcase.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
common:
filter: not (CONFIG_NATIVE_BUILD and CONFIG_EXTERNAL_LIBC)
# FIXME: qemu_leon3 is excluded because of the alignment-related failure
# reported in the GitHub issue zephyrproject-rtos/zephyr#48992.
platform_exclude:
- qemu_leon3
- native_posix
- native_posix_64
tags: posix
Expand Down