Files
CMock/test
André Draszik 2568a3657f return_thru_ptr: fix Wsign-conversion warning
Compiling a source base / test with Wsign-conversion enabled, gives
the following warning:

build/test/mocks/mock_logMessages.c: In function ‘countLogMessages’:
build/test/mocks/mock_logMessages.c:749:26: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
  749 |       cmock_call_instance->ReturnThruPtr_fileIn_Size);
      |       ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

The ReturnThruPtr_XXX_Size is used as argument to a call to memcpy(),
which expects size_t (unsigned) for a good reason. The size leading
to this call is being determined using sizeof(), so there appears
no reason to ever convert this to (signed) int.

Stop converting size_t to int, and thereby fix the compiler
warning.

Signed-off-by: André Draszik <git@andred.net>
2020-05-25 07:45:34 +01:00
..
2020-03-12 17:08:51 -04:00