public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2024-01-29 17:55 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:55 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b5fd44177ca9bd5e17f201d89ff67229860b5adc
commit b5fd44177ca9bd5e17f201d89ff67229860b5adc
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 1b8cb722c5..ab1e46ff7d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -177,6 +178,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -184,6 +189,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,6 +216,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -221,6 +230,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -233,8 +243,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2024-04-17 20:05 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:05 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ed63857295eb3d48e9114ae4c697f65d5d83635a
commit ed63857295eb3d48e9114ae4c697f65d5d83635a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 4af87f54fd..4186292b24 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -181,8 +182,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int l, vl;
if (has_ts)
- l = __snprintf (bufs, sizeof bufs,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ /* clang complains that adding a 'int_t' to a string does not append to
+ it, but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ l = __snprintf (bufs, sizeof bufs,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -239,8 +247,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int cl;
if (has_ts)
- cl = __snprintf (buf, l + 1,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ cl = __snprintf (buf, l + 1,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
cl = __snprintf (buf, l + 1,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -273,8 +286,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2024-04-02 15:51 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=955a1270d1d1073d88d85ac9857e636bac8fbc7c
commit 955a1270d1d1073d88d85ac9857e636bac8fbc7c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 4af87f54fd..4186292b24 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -181,8 +182,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int l, vl;
if (has_ts)
- l = __snprintf (bufs, sizeof bufs,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ /* clang complains that adding a 'int_t' to a string does not append to
+ it, but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ l = __snprintf (bufs, sizeof bufs,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -239,8 +247,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int cl;
if (has_ts)
- cl = __snprintf (buf, l + 1,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ cl = __snprintf (buf, l + 1,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
cl = __snprintf (buf, l + 1,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -273,8 +286,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2024-02-09 17:29 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:29 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=30dd439c6241553df5a52adabc467d77d2512234
commit 30dd439c6241553df5a52adabc467d77d2512234
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 4af87f54fd..4186292b24 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -181,8 +182,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int l, vl;
if (has_ts)
- l = __snprintf (bufs, sizeof bufs,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ /* clang complains that adding a 'int_t' to a string does not append to
+ it, but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ l = __snprintf (bufs, sizeof bufs,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -239,8 +247,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int cl;
if (has_ts)
- cl = __snprintf (buf, l + 1,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ cl = __snprintf (buf, l + 1,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
cl = __snprintf (buf, l + 1,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -273,8 +286,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2024-02-07 14:04 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:04 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7187a79c605c0ff825048f9994b887a9822716d7
commit 7187a79c605c0ff825048f9994b887a9822716d7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 4af87f54fd..4186292b24 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -181,8 +182,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int l, vl;
if (has_ts)
- l = __snprintf (bufs, sizeof bufs,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ /* clang complains that adding a 'int_t' to a string does not append to
+ it, but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ l = __snprintf (bufs, sizeof bufs,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -239,8 +247,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
int cl;
if (has_ts)
- cl = __snprintf (buf, l + 1,
- SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ cl = __snprintf (buf, l + 1,
+ SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
else
cl = __snprintf (buf, l + 1,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
@@ -273,8 +286,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2023-12-21 18:51 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41d1aa9e39c19b2bd0ab8ec91ffc5a853ba16388
commit 41d1aa9e39c19b2bd0ab8ec91ffc5a853ba16388
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 1b8cb722c5..ab1e46ff7d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -177,6 +178,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -184,6 +189,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,6 +216,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -221,6 +230,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -233,8 +243,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2023-09-28 17:49 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:49 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c9730cb3e225d070f29626c22a3e15553163837f
commit c9730cb3e225d070f29626c22a3e15553163837f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
clang complains that adding a 'int_t' to a string does not append
to it, but the idea is to print the pid conditionally.
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 1b8cb722c5..ab1e46ff7d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -177,6 +178,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -184,6 +189,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,6 +216,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -221,6 +230,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -233,8 +243,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2023-08-30 12:34 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:34 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f75c42c25cf429dd6050a38147a99dfc55486a3a
commit f75c42c25cf429dd6050a38147a99dfc55486a3a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index 1b8cb722c5..ab1e46ff7d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -177,6 +178,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -184,6 +189,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,6 +216,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -221,6 +230,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -233,8 +243,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2023-02-09 19:46 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:46 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89d961ea68b9e908f897f1d8488bac9045b435ad
commit 89d961ea68b9e908f897f1d8488bac9045b435ad
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index f67d4b58a4..a2712d3a30 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -207,6 +214,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -219,6 +228,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -231,8 +241,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-10-28 17:39 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:39 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f221a34710cc48552f43b26a716d70651e9ed183
commit f221a34710cc48552f43b26a716d70651e9ed183
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index f67d4b58a4..a2712d3a30 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -207,6 +214,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -219,6 +228,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -231,8 +241,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-10-04 12:57 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:57 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0bc6163bb7a2dc85d0746947052527b4335db2af
commit 0bc6163bb7a2dc85d0746947052527b4335db2af
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index f67d4b58a4..a2712d3a30 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -207,6 +214,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (buf, l + 1,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
@@ -219,6 +228,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
__vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
mode_flags);
va_end (apc);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -231,8 +241,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-06-09 21:26 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:26 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f6247b18a47943d60b152804d51e96dbeabbad25
commit f6247b18a47943d60b152804d51e96dbeabbad25
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-06-09 13:23 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:23 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f6247b18a47943d60b152804d51e96dbeabbad25
commit f6247b18a47943d60b152804d51e96dbeabbad25
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-06-03 14:12 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:12 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1e2b92ca1b61b7ea86b5bad661b9275c567b9f89
commit 1e2b92ca1b61b7ea86b5bad661b9275c567b9f89
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-05-13 14:26 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:26 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e26f8e86502a0d38069926e64345c97244f3c610
commit e26f8e86502a0d38069926e64345c97244f3c610
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-05-12 19:40 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:40 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3c9c183dcbae6999861a0f3493d83dd1ad3abb21
commit 3c9c183dcbae6999861a0f3493d83dd1ad3abb21
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-05-10 18:30 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:30 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6e1d228224fc5543476b0e7f5045d9c2a0accea2
commit 6e1d228224fc5543476b0e7f5045d9c2a0accea2
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [glibc/azanella/clang] misc: Suppress clang warnings on syslog
@ 2022-04-29 14:10 Adhemerval Zanella
0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:10 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6371ae6420ff501842d6ce1a4928cefc176c533e
commit 6371ae6420ff501842d6ce1a4928cefc176c533e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 29 10:50:13 2022 -0300
misc: Suppress clang warnings on syslog
Diff:
---
misc/syslog.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/misc/syslog.c b/misc/syslog.c
index a1b67f6527..b217ef007d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -31,6 +31,7 @@
static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
+#include <libc-diag.h>
#include <libio/libioP.h>
#include <paths.h>
#include <stdarg.h>
@@ -175,6 +176,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
#define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \
"<%d>: %n", __pri, __msgoff
+ /* clang complains that adding a 'int_t' to a string does not append to it,
+ but the idea is to print the pid conditionally. */
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
int l;
if (has_ts)
l = __snprintf (bufs, sizeof bufs,
@@ -182,6 +187,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
else
l = __snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+
if (0 <= l && l < sizeof bufs)
{
va_list apc;
@@ -209,12 +216,15 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Tell the cancellation handler to free this buffer. */
clarg.buf = buf;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (has_ts)
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
else
__snprintf (bufs, sizeof bufs,
SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
else
{
@@ -227,8 +237,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
/* Output to stderr if requested. */
if (LogStat & LOG_PERROR)
- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
- "\n" + (buf[bufsize - 1] == '\n'));
+ {
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
+ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
+ "\n" + (buf[bufsize - 1] == '\n'));
+ DIAG_POP_NEEDS_COMMENT_CLANG;
+ }
/* Get connected, output the message to the local logger. */
if (!connected)
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2024-04-17 20:05 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-29 17:55 [glibc/azanella/clang] misc: Suppress clang warnings on syslog Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:05 Adhemerval Zanella
2024-04-02 15:51 Adhemerval Zanella
2024-02-09 17:29 Adhemerval Zanella
2024-02-07 14:04 Adhemerval Zanella
2023-12-21 18:51 Adhemerval Zanella
2023-09-28 17:49 Adhemerval Zanella
2023-08-30 12:34 Adhemerval Zanella
2023-02-09 19:46 Adhemerval Zanella
2022-10-28 17:39 Adhemerval Zanella
2022-10-04 12:57 Adhemerval Zanella
2022-06-09 21:26 Adhemerval Zanella
2022-06-09 13:23 Adhemerval Zanella
2022-06-03 14:12 Adhemerval Zanella
2022-05-13 14:26 Adhemerval Zanella
2022-05-12 19:40 Adhemerval Zanella
2022-05-10 18:30 Adhemerval Zanella
2022-04-29 14:10 Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).