Re: [PATCH rdma-core 2/5] util: Fix check_snprintf to use __rc__ for local

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux