spa: mark the gettext wrappers with __attribute__((format_arg))

This removes the -Wformat-literal warnings for all _("some message")
calls. Remaining warnings are those where we pass in a custom buffer.
This commit is contained in:
Peter Hutterer 2021-09-02 13:44:24 +10:00
parent b5ad37c7ac
commit 6a18272fed
3 changed files with 5 additions and 2 deletions

View file

@ -31,8 +31,8 @@ extern "C" {
#include <spa/support/i18n.h>
const char *pw_gettext(const char *msgid);
const char *pw_ngettext(const char *msgid, const char *msgid_plural, unsigned long int n);
SPA_FORMAT_ARG_FUNC(1) const char *pw_gettext(const char *msgid);
SPA_FORMAT_ARG_FUNC(1) const char *pw_ngettext(const char *msgid, const char *msgid_plural, unsigned long int n);
#define _(String) (pw_gettext(String))
#define N_(String) (String)