On 16.03.2012 20:21, Anthony Liguori wrote:
> On 03/15/2012 04:00 PM, Michael Tokarev wrote:
[]
>> +ssize_t iov_send_recv(int sockfd, struct iovec *iov,
>> +                      size_t offset, size_t bytes, bool do_send);
>> +#define iov_recv(sockfd, iov, offset, bytes) \
>> +  iov_send_recv(sockfd, iov, offset, bytes, false)
>> +#define iov_send(sockfd, iov, offset, bytes) \
>> +  iov_send_recv(sockfd, iov, offset, bytes, true)
> 
> Please use a static inline instead of a macro.  Macros make compiler 
> errors/warnings confusing.

Macros are good when used properly, and this is one of examples
of good usage: no confusion in this case.

An example of really confusing macro which were accepted recently
is qemu_recv, which not only makes errors/warning confusing, but
also makes type checking impossible.

I can change these into inline functions, but that just takes
much more lines of "code" and more difficult to see what it
does.

Thanks,

/mjt

Reply via email to