PR c/82063 - issues with arguments enabled by -Wall
authorMartin Sebor <msebor@redhat.com>
Thu, 31 May 2018 17:04:43 +0000 (17:04 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Thu, 31 May 2018 17:04:43 +0000 (11:04 -0600)
commitd258f4aa696e770d7a06f960c34531804e649900
tree2b6dac6be9352a05bbc3fe624037fdf0438691b5
parent3217e694854fe50be13091f071283f47aad9b348
PR c/82063 - issues with arguments enabled by -Wall

gcc/c-family/ChangeLog:

PR c/82063
* c.opt (-Wno-alloc-size-larger-than): New option.
* doc/invoke.texi (-Walloc-size-larger-than): Update.

gcc/ChangeLog:

PR c/82063
* calls.c (alloc_max_size): Correct a logic error/typo.
Treat excessive arguments as infinite.  Warn for invalid arguments.

gcc/testsuite/ChangeLog:

PR c/82063
* gcc.dg/Walloc-size-larger-than-1.c: New test.
* gcc.dg/Walloc-size-larger-than-10.c: New test.
* gcc.dg/Walloc-size-larger-than-11.c: New test.
* gcc.dg/Walloc-size-larger-than-12.c: New test.
* gcc.dg/Walloc-size-larger-than-13.c: New test.
* gcc.dg/Walloc-size-larger-than-14.c: New test.
* gcc.dg/Walloc-size-larger-than-15.c: New test.
* gcc.dg/Walloc-size-larger-than-16.c: New test.
* gcc.dg/Walloc-size-larger-than-17.c: New test.
* gcc.dg/Walloc-size-larger-than-2.c: New test.
* gcc.dg/Walloc-size-larger-than-3.c: New test.
* gcc.dg/Walloc-size-larger-than-4.c: New test.
* gcc.dg/Walloc-size-larger-than-5.c: New test.
* gcc.dg/Walloc-size-larger-than-6.c: New test.
* gcc.dg/Walloc-size-larger-than-7.c: New test.
* gcc.dg/Walloc-size-larger-than-8.c: New test.
* gcc.dg/Walloc-size-larger-than-9.c: New test.
* gcc.dg/Walloc-size-larger-than.c: New test.

From-SVN: r261030
24 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/calls.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Walloc-size-larger-than-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-10.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-11.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-12.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-13.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-14.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-15.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-16.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-17.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloc-size-larger-than.c [new file with mode: 0644]