mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Martin Wilck <mwilck@suse.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	Sagi Grimberg <sagi@grimberg.me>, Christoph Hellwig <hch@lst.de>
Subject: include/linux/string.h:413: error: '______f' is static but declared in inline function 'memcpy_and_pad' which is not static
Date: Sun, 10 Sep 2017 07:12:53 +0800	[thread overview]
Message-ID: <201709100750.GLoALoo0%fengguang.wu@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4dfc2788033d30dfccfd4268e06dd73ce2c654ed
commit: 01f33c336e2d298ea5d4ce5d6e5bcd12865cc30f string.h: add memcpy_and_pad()
date:   12 days ago
config: x86_64-randconfig-b0-09100601 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
        git checkout 01f33c336e2d298ea5d4ce5d6e5bcd12865cc30f
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   cc1: warnings being treated as errors
   In file included from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from arch/x86/include/asm/cpumask.h:4,
                    from arch/x86/include/asm/msr.h:10,
                    from arch/x86/include/asm/processor.h:20,
                    from arch/x86/include/asm/cpufeature.h:4,
                    from arch/x86/include/asm/thread_info.h:52,
                    from include/linux/thread_info.h:37,
                    from arch/x86/include/asm/preempt.h:6,
                    from include/linux/preempt.h:80,
                    from include/linux/spinlock.h:50,
                    from include/linux/mmzone.h:7,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from include/linux/resource_ext.h:19,
                    from include/linux/acpi.h:26,
                    from drivers/gpu//drm/i915/i915_drv.c:30:
   include/linux/string.h: In function 'memcpy_and_pad':
>> include/linux/string.h:413: error: '______f' is static but declared in inline function 'memcpy_and_pad' which is not static
   include/linux/string.h:414: error: '______f' is static but declared in inline function 'memcpy_and_pad' which is not static
   include/linux/string.h:416: error: '______f' is static but declared in inline function 'memcpy_and_pad' which is not static
   include/linux/string.h:419: error: '______f' is static but declared in inline function 'memcpy_and_pad' which is not static
   include/linux/string.h:421: error: '______f' is static but declared in inline function 'memcpy_and_pad' which is not static

vim +413 include/linux/string.h

   398	
   399	/**
   400	 * memcpy_and_pad - Copy one buffer to another with padding
   401	 * @dest: Where to copy to
   402	 * @dest_len: The destination buffer size
   403	 * @src: Where to copy from
   404	 * @count: The number of bytes to copy
   405	 * @pad: Character to use for padding if space is left in destination.
   406	 */
   407	__FORTIFY_INLINE void memcpy_and_pad(void *dest, size_t dest_len,
   408					     const void *src, size_t count, int pad)
   409	{
   410		size_t dest_size = __builtin_object_size(dest, 0);
   411		size_t src_size = __builtin_object_size(src, 0);
   412	
 > 413		if (__builtin_constant_p(dest_len) && __builtin_constant_p(count)) {
   414			if (dest_size < dest_len && dest_size < count)
   415				__write_overflow();
   416			else if (src_size < dest_len && src_size < count)
   417				__read_overflow3();
   418		}
   419		if (dest_size < dest_len)
   420			fortify_panic(__func__);
   421		if (dest_len > count) {
   422			memcpy(dest, src, count);
   423			memset(dest + count, pad,  dest_len - count);
   424		} else
   425			memcpy(dest, src, dest_len);
   426	}
   427	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

                 reply	other threads:[~2017-09-09 23:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201709100750.GLoALoo0%fengguang.wu@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=hch@lst.de \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mwilck@suse.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®