msvcp90/msvcp90.h: right-hand operand of comma expression has no effect (PING)

Alexandre Julliard julliard at winehq.org
Thu Jun 12 03:26:19 CDT 2014


Gerald Pfeifer <gerald at pfeifer.com> writes:

> On Wed, 16 Apr 2014, Paul Chitescu wrote:
>>> Digging into this in more detail I see
>>>
>>>   ../msvcp90/ios.c: In function 'basic_streambuf_char__Xsgetn_s':
>>>   ../msvcp90/msvcp90.h:529:75: warning: right-hand operand of comma
>>> expression has no effect [-Wunused-value]
>>>   #define memcpy_s( dst, size, src, count ) (memcpy( (dst), (src), (count)
>>> ), 0) ^ ../msvcp90/ios.c:1218:13: note: in expansion of macro 'memcpy_s'
>>> memcpy_s(ptr+copied, size, *this->prpos, chunk);
>>>              ^
>> memcpy_s() returns an errno_t so the author tried to force returning 
>> zero (no error).
>
> Since, clearly, the result is never intended to be used, we can as
> well simply cast the result away instead of using ", 0".

memcpy_s is supposed to return a value, and callers could (and probably
should) check it.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list