All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: linux-trace-devel@vger.kernel.org,
	Tzvetomir Stoyanov <tz.stoyanov@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Claire Jensen <cjense@google.com>
Cc: Ian Rogers <irogers@google.com>
Subject: [PATCH 1/2] libtracefs: Silence non-literal-null-conversion warning
Date: Tue,  3 Aug 2021 17:41:08 -0700	[thread overview]
Message-ID: <20210804004109.1476661-1-irogers@google.com> (raw)

On clang the warning looks like:

src/tracefs-utils.c:473:15: error: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Werror,-Wnon-literal-null-conversion]
        list[size] = '\0';

Signed-off-by: Ian Rogers <irogers@google.com>
---
 src/tracefs-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tracefs-utils.c b/src/tracefs-utils.c
index 63bb413..a502c2d 100644
--- a/src/tracefs-utils.c
+++ b/src/tracefs-utils.c
@@ -470,7 +470,7 @@ int tracefs_list_pop(char **list)
 	size--;
 	*list = (char *)size;
 	list++;
-	list[size] = '\0';
+	list[size] = NULL;
 	return 0;
 }
 
-- 
2.32.0.554.ge1b32706d8-goog


             reply	other threads:[~2021-08-04  0:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  0:41 Ian Rogers [this message]
2021-08-04  0:41 ` [PATCH 2/2] libtracefs: Silence sometimes-uninitialized warning Ian Rogers
2021-08-04  0:51   ` Steven Rostedt
2021-08-04  0:50 ` [PATCH 1/2] libtracefs: Silence non-literal-null-conversion warning Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210804004109.1476661-1-irogers@google.com \
    --to=irogers@google.com \
    --cc=cjense@google.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tz.stoyanov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.