public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
Cc: "NMoreyChaisemartin-l3A5Bk7waGM@public.gmane.org"
	<NMoreyChaisemartin-l3A5Bk7waGM@public.gmane.org>,
	"leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH rdma-core 2/5] util: Fix check_snprintf to use __rc__ for local
Date: Fri, 1 Sep 2017 09:47:33 -0600	[thread overview]
Message-ID: <20170901154733.GA11102@obsidianresearch.com> (raw)
In-Reply-To: <1504278799.14386.1.camel-Sjgp3cTcYWE@public.gmane.org>

On Fri, Sep 01, 2017 at 03:13:20PM +0000, Bart Van Assche wrote:

> > #define check_snprintf(buf, len, fmt, ...)    \
> > 	__good_snprintf(len, snprintf(buf, len, fmt, ##__VA_ARGS__))
> 
> If an inline function will be introduced anyway, why not to make check_snprintf()
> itself an inline function and use vsnprintf() instead of snprintf()?

Well.. Generally speaking I prefer to avoid wrappering 'magic'
functions like snprintf with inlines because you loose the 'magic'.

eg, however it is done, modern gcc triggers -Wformat-length analysis
for snprintf, and if you wrapper it with an inline it appears that
analysis is lost. This is separate from the well known
attribute((printf)).

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-09-01 15:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 20:50 [PATCH rdma-core 0/5] Small fixes for verbs Jason Gunthorpe
     [not found] ` <1504212659-9674-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-31 20:50   ` [PATCH rdma-core 1/5] verbs: Remove diagnostic ignored "-Wmissing-prototypes" Jason Gunthorpe
2017-08-31 20:50   ` [PATCH rdma-core 2/5] util: Fix check_snprintf to use __rc__ for local Jason Gunthorpe
     [not found]     ` <1504212659-9674-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-01  4:56       ` Leon Romanovsky
     [not found]         ` <20170901045632.GJ10539-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-09-01  7:00           ` Nicolas Morey-Chaisemartin
     [not found]             ` <e10f536a-bad3-55b4-f3ef-207404209c89-l3A5Bk7waGM@public.gmane.org>
2017-09-01  9:35               ` Leon Romanovsky
     [not found]                 ` <20170901093553.GK10539-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-09-01  9:46                   ` Nicolas Morey-Chaisemartin
     [not found]                     ` <dfa51066-0d39-5d31-c7e6-b2af1a6089a5-l3A5Bk7waGM@public.gmane.org>
2017-09-01 14:13                       ` Leon Romanovsky
2017-09-01 15:00           ` Jason Gunthorpe
     [not found]             ` <20170901150013.GA21378-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-01 15:13               ` Bart Van Assche
     [not found]                 ` <1504278799.14386.1.camel-Sjgp3cTcYWE@public.gmane.org>
2017-09-01 15:47                   ` Jason Gunthorpe [this message]
2017-08-31 20:50   ` [PATCH rdma-core 3/5] verbs: Use ccan list.h instead of open coding lists Jason Gunthorpe
     [not found]     ` <1504212659-9674-4-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-01  7:05       ` Nicolas Morey-Chaisemartin
     [not found]         ` <b4255929-e0bc-d779-7190-f38fea24395e-l3A5Bk7waGM@public.gmane.org>
2017-09-02  1:47           ` Jason Gunthorpe
2017-08-31 20:50   ` [PATCH rdma-core 4/5] verbs: Tidy up ibverbs_get_device_list Jason Gunthorpe
     [not found]     ` <1504212659-9674-5-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-03 14:03       ` Leon Romanovsky
     [not found]         ` <20170903140351.GO10539-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-09-03 14:48           ` Jason Gunthorpe
     [not found]             ` <20170903144839.GA20230-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-03 17:25               ` Leon Romanovsky
2017-08-31 20:50   ` [PATCH rdma-core 5/5] ocrdma: Remove ocrdma_dev_list Jason Gunthorpe
2017-09-04 12:07   ` [PATCH rdma-core 0/5] Small fixes for verbs Yishai Hadas

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=20170901154733.GA11102@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org \
    --cc=NMoreyChaisemartin-l3A5Bk7waGM@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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