Commit d3d6f724 by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/30729 (value computed is not used warning with unused result of va_arg)

2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/30729
        * stmt.c (warn_if_unused_value): VA_ARG_EXPR has side
        effects unknown to this function, return early.

2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/30729
        * gcc.dg/Wunused-value-2.c: New testcase.

From-SVN: r122027
parent d0fc3f06
2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/30729
* stmt.c (warn_if_unused_value): VA_ARG_EXPR has side
effects unknown to this function, return early.
2007-02-15 Ian Lance Taylor <iant@google.com>
* lower-subreg.c (move_eh_region_note): New static function.
......
......@@ -1425,6 +1425,7 @@ warn_if_unused_value (tree exp, location_t locus)
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
case EXIT_EXPR:
case VA_ARG_EXPR:
return 0;
case BIND_EXPR:
......
2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/30729
* gcc.dg/Wunused-value-2.c: New testcase.
2007-02-15 Ian Lance Taylor <iant@google.com>
* g++.dg/eh/subreg-1.C: New test.
/* Test -Wunused-value. Bug 30729. */
/* { dg-do compile } */
/* { dg-options "-Wunused-value" } */
/* Make sure va_arg does not cause a value computed is not used warning
because it has side effects. */
#include <stdarg.h>
int f(int t, ...)
{
va_list a;
va_start (a, t);
va_arg(a, int);/* { dg-bogus "value computed is not used" } */
int t1 = va_arg(a, int);
va_end(a);
return t1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment