X Tutup
Skip to content

Commit 56e577c

Browse files
committed
tree-wide: use DISABLE_WARNING_FORMAT_NONLITERAL where appropriate
1 parent 6a5b28d commit 56e577c

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

src/core/selinux-access.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
123123
fmt2 = strjoina("selinux: ", fmt);
124124

125125
va_start(ap, fmt);
126-
#pragma GCC diagnostic push
127-
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
126+
127+
DISABLE_WARNING_FORMAT_NONLITERAL;
128128
log_internalv(LOG_AUTH | callback_type_to_priority(type),
129129
0, PROJECT_FILE, __LINE__, __FUNCTION__,
130130
fmt2, ap);
131-
#pragma GCC diagnostic pop
131+
REENABLE_WARNING;
132132
va_end(ap);
133133

134134
return 0;

src/fstab-generator/fstab-generator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ static int write_dependency(
263263
res = strv_join(units, " ");
264264
if (!res)
265265
return log_oom();
266-
#pragma GCC diagnostic push
267-
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
266+
267+
DISABLE_WARNING_FORMAT_NONLITERAL;
268268
fprintf(f, format, res);
269-
#pragma GCC diagnostic pop
269+
REENABLE_WARNING;
270270
}
271271

272272
return 0;

src/journal-remote/microhttpd-util.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ int mhd_respondf(struct MHD_Connection *connection,
7878
errno = -error;
7979
fmt = strjoina(format, "\n");
8080
va_start(ap, format);
81-
#pragma GCC diagnostic push
82-
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
81+
DISABLE_WARNING_FORMAT_NONLITERAL;
8382
r = vasprintf(&m, fmt, ap);
84-
#pragma GCC diagnostic pop
83+
REENABLE_WARNING;
8584
va_end(ap);
8685

8786
if (r < 0)

src/locale/localed.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,9 @@ static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char
499499
const char *fmt;
500500

501501
fmt = strjoina("libxkbcommon: ", format);
502-
#pragma GCC diagnostic push
503-
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
502+
DISABLE_WARNING_FORMAT_NONLITERAL;
504503
log_internalv(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, fmt, args);
505-
#pragma GCC diagnostic pop
504+
REENABLE_WARNING;
506505
}
507506

508507
#define LOAD_SYMBOL(symbol, dl, name) \

src/udev/udev-builtin-net_id.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,10 @@ static int names_platform(sd_device *dev, struct netnames *names, bool test) {
449449
* The Vendor (3 or 4 char), followed by hexdecimal model number : instance id.
450450
*/
451451

452-
#pragma GCC diagnostic push
453-
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
452+
DISABLE_WARNING_FORMAT_NONLITERAL;
454453
if (sscanf(syspath, pattern, vendor, &model, &instance, &ethid) != 4)
455454
return -EINVAL;
456-
#pragma GCC diagnostic pop
455+
REENABLE_WARNING;
457456

458457
if (!in_charset(vendor, validchars))
459458
return -ENOENT;

0 commit comments

Comments
 (0)
X Tutup