gcc 8 warning

Bruno Wolff III bruno at wolff.to
Tue Jan 30 16:38:59 CET 2018


While there were a few other warnings about sibling call from callable 
instruction with modified stack frame, the following looked more significant if 
it isn't a gcc bug.
  CC [M]  /home/bruno/WireGuard/src/crypto/chacha20poly1305.o
In file included from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:21,
                 from ./arch/x86/include/asm/cpufeature.h:5,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from ./include/linux/thread_info.h:38,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/skbuff.h:19,
                 from ./include/linux/ip.h:20,
                 from /home/bruno/WireGuard/src/compat/compat.h:583,
                 from <command-line>:
In function ‘memcpy’,
    inlined from ‘poly1305_update’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:549:4,
    inlined from ‘chacha20poly1305_encrypt_sg’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:673:4:
./include/linux/string.h:344:9: warning: ‘__builtin_memcpy’ forming offset [233, 272] is out of the bounds [0, 232] of object ‘poly1305_state’ with type ‘struct poly1305_ctx’ [-Warray-bounds]
  return __builtin_memcpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c: In function ‘chacha20poly1305_encrypt_sg’:
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c:652:22: note: ‘poly1305_state’ declared here
  struct poly1305_ctx poly1305_state;
                      ^~~~~~~~~~~~~~
In file included from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:21,
                 from ./arch/x86/include/asm/cpufeature.h:5,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from ./include/linux/thread_info.h:38,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/skbuff.h:19,
                 from ./include/linux/ip.h:20,
                 from /home/bruno/WireGuard/src/compat/compat.h:583,
                 from <command-line>:
In function ‘memcpy’,
    inlined from ‘poly1305_update’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:549:4,
    inlined from ‘chacha20poly1305_decrypt_sg’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:789:4:
./include/linux/string.h:344:9: warning: ‘__builtin_memcpy’ forming offset [233, 272] is out of the bounds [0, 232] of object ‘poly1305_state’ with type ‘struct poly1305_ctx’ [-Warray-bounds]
  return __builtin_memcpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c: In function ‘chacha20poly1305_decrypt_sg’:
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c:764:22: note: ‘poly1305_state’ declared here
  struct poly1305_ctx poly1305_state;
                      ^~~~~~~~~~~~~~



More information about the WireGuard mailing list