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

Ignore unterminated string initialization for hexchar #1030

Merged
Merged
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
10 changes: 10 additions & 0 deletions src/libbluechi/bus/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,20 @@ int assemble_object_path_string(const char *prefix, const char *name, char **res
return asprintf(res, "%s/%s", prefix, escaped);
}

// Disabling -Wunterminated-string-initialization temporarily.
// hexchar uses the table array only for mapping an integer to
// a hexadecimal char, no need for it to be NULL terminated.
#if __GNUC__ >= 15
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunterminated-string-initialization"
#endif
static char hexchar(int x) {
static const char table[16] = "0123456789abcdef";
return table[(unsigned int) x % sizeof(table)];
}
#if __GNUC__ >= 15
# pragma GCC diagnostic pop
#endif

char *bus_path_escape(const char *s) {

Expand Down
Loading