Linux-Trace-Devel Archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Ross Zwisler <zwisler@google.com>,
	Stevie Alvarez <stevie.6strings@gmail.com>
Subject: Re: [RFC][PATCH] libtraceeval: Add size checks to insert and query functions
Date: Tue, 15 Aug 2023 21:15:20 -0400	[thread overview]
Message-ID: <20230815211520.1065d090@gandalf.local.home> (raw)
In-Reply-To: <20230815211052.7c56695d@gandalf.local.home>

On Tue, 15 Aug 2023 21:10:52 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> > +#define traceeval_insert(teval, keys, vals)				\
> > +	traceeval_insert_size(teval, keys, sizeof(keys) / sizeof(keys[0]), \
> > +			      vals, sizeof(vals) / sizeof(vals[0]))
> >    
> 
> I just realized that vals may be NULL, so the above needs to be:
> 
> #define traceeval_insert(teval, keys, vals)				\
> 	traceeval_insert_size(teval, keys, sizeof(keys) / sizeof(keys[0]), \
> 			      vals, vals ? sizeof(vals) / sizeof(vals[0]) : 0)

Nevermind. NULL won't compile (and neither will the above).

-- Steve

      reply	other threads:[~2023-08-16  1:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  0:02 [RFC][PATCH] libtraceeval: Add size checks to insert and query functions Steven Rostedt
2023-08-16  1:04 ` Steven Rostedt
2023-08-16  1:10 ` Steven Rostedt
2023-08-16  1:15   ` Steven Rostedt [this message]

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=20230815211520.1065d090@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=stevie.6strings@gmail.com \
    --cc=zwisler@google.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 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).