All of lore.kernel.org
 help / color / mirror / Atom feed
* [sashal-linux-stable:queue-4.4 7/9] lib/string.c:286:29: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'int'} and 'size_t' {aka 'unsigned int'}
@ 2021-02-11  8:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-11  8:25 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2967 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.4
head:   1b1f51f356b83b52e29cb6c196b8d2c26fd6f6a9
commit: 322fc73a4c278c1ffb086f99f2e35c318d5a4baa [7/9] lib/string: Add strscpy_pad() function
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=322fc73a4c278c1ffb086f99f2e35c318d5a4baa
        git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
        git fetch --no-tags sashal-linux-stable queue-4.4
        git checkout 322fc73a4c278c1ffb086f99f2e35c318d5a4baa
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   lib/string.c: In function 'strscpy_pad':
>> lib/string.c:286:29: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'int'} and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
     286 |  if (written < 0 || written == count - 1)
         |                             ^~


vim +286 lib/string.c

   261	
   262	/**
   263	 * strscpy_pad() - Copy a C-string into a sized buffer
   264	 * @dest: Where to copy the string to
   265	 * @src: Where to copy the string from
   266	 * @count: Size of destination buffer
   267	 *
   268	 * Copy the string, or as much of it as fits, into the dest buffer.  The
   269	 * behavior is undefined if the string buffers overlap.  The destination
   270	 * buffer is always %NUL terminated, unless it's zero-sized.
   271	 *
   272	 * If the source string is shorter than the destination buffer, zeros
   273	 * the tail of the destination buffer.
   274	 *
   275	 * For full explanation of why you may want to consider using the
   276	 * 'strscpy' functions please see the function docstring for strscpy().
   277	 *
   278	 * Return: The number of characters copied (not including the trailing
   279	 *         %NUL) or -E2BIG if the destination buffer wasn't big enough.
   280	 */
   281	ssize_t strscpy_pad(char *dest, const char *src, size_t count)
   282	{
   283		ssize_t written;
   284	
   285		written = strscpy(dest, src, count);
 > 286		if (written < 0 || written == count - 1)
   287			return written;
   288	
   289		memset(dest + written + 1, 0, count - written - 1);
   290	
   291		return written;
   292	}
   293	EXPORT_SYMBOL(strscpy_pad);
   294	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37945 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-11  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  8:25 [sashal-linux-stable:queue-4.4 7/9] lib/string.c:286:29: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'int'} and 'size_t' {aka 'unsigned int'} kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.