public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/30729]  New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg
@ 2007-02-07 20:18 pinskia at gcc dot gnu dot org
  2007-02-07 20:24 ` [Bug c/30729] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-07 20:18 UTC (permalink / raw)
  To: gcc-bugs

#include <stdarg.h>

int f(int t, ...)
{
  va_list a;
  va_start (a, t);
  va_arg(a, int);
  int t1 = va_arg(a, int);
  va_end(a);
  return t1;
}


-----
We get a warning on the line which just contains va_arg(a, int);
Even though the value is not used, a is still incremented so the result is not
unused after all.

t.c:7: warning: value computed is not used


-- 
           Summary: [4.1/4.2/4.3 Regression] value computed is not used
                    warning with unused result of va_arg
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/30729] [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
@ 2007-02-07 20:24 ` pinskia at gcc dot gnu dot org
  2007-02-09 22:10 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-07 20:24 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/30729] [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
  2007-02-07 20:24 ` [Bug c/30729] " pinskia at gcc dot gnu dot org
@ 2007-02-09 22:10 ` pinskia at gcc dot gnu dot org
  2007-02-14  9:22 ` [Bug middle-end/30729] " mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-09 22:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-02-09 22:10 -------
I have a fix, ignore VA_ARG_EXPR in warn_if_unused_value like the rest of the
modify epxressions.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-02-09 22:10:12
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
  2007-02-07 20:24 ` [Bug c/30729] " pinskia at gcc dot gnu dot org
  2007-02-09 22:10 ` pinskia at gcc dot gnu dot org
@ 2007-02-14  9:22 ` mmitchel at gcc dot gnu dot org
  2007-02-16  1:19 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:22 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-02-14  9:22 ` [Bug middle-end/30729] " mmitchel at gcc dot gnu dot org
@ 2007-02-16  1:19 ` pinskia at gcc dot gnu dot org
  2007-02-16  1:20 ` [Bug middle-end/30729] [4.1/4.2 " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-16  1:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-02-16 01:19 -------
Subject: Bug 30729

Author: pinskia
Date: Fri Feb 16 01:19:23 2007
New Revision: 122027

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122027
Log:
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.


Added:
    trunk/gcc/testsuite/gcc.dg/Wunused-value-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/stmt.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1/4.2 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-02-16  1:19 ` pinskia at gcc dot gnu dot org
@ 2007-02-16  1:20 ` pinskia at gcc dot gnu dot org
  2007-02-19 21:05 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-16  1:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-02-16 01:20 -------
Fixed on the trunk, will apply to the other branches later.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3 Regression]    |[4.1/4.2 Regression] value
                   |value computed is not used  |computed is not used warning
                   |warning with unused result  |with unused result of va_arg
                   |of va_arg                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1/4.2 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-02-16  1:20 ` [Bug middle-end/30729] [4.1/4.2 " pinskia at gcc dot gnu dot org
@ 2007-02-19 21:05 ` mmitchel at gcc dot gnu dot org
  2007-03-09 23:20 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-19 21:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1/4.2 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-02-19 21:05 ` mmitchel at gcc dot gnu dot org
@ 2007-03-09 23:20 ` pinskia at gcc dot gnu dot org
  2007-04-15  1:28 ` [Bug middle-end/30729] [4.1 " pinskia at gcc dot gnu dot org
  2007-04-15  1:28 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-09 23:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-03-09 23:20 -------
Subject: Bug 30729

Author: pinskia
Date: Fri Mar  9 23:20:28 2007
New Revision: 122769

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122769
Log:
2007-03-09  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-03-09  Andrew Pinski  <andrew_pinski@playstation.sony.com>

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


Added:
    branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/Wunused-value-2.c
      - copied unchanged from r122027,
trunk/gcc/testsuite/gcc.dg/Wunused-value-2.c
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/stmt.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-03-09 23:20 ` pinskia at gcc dot gnu dot org
@ 2007-04-15  1:28 ` pinskia at gcc dot gnu dot org
  2007-04-15  1:28 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-15  1:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-04-15 02:28 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/30729] [4.1 Regression] value computed is not used warning with unused result of va_arg
  2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-04-15  1:28 ` [Bug middle-end/30729] [4.1 " pinskia at gcc dot gnu dot org
@ 2007-04-15  1:28 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-15  1:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-04-15 02:28 -------
Subject: Bug 30729

Author: pinskia
Date: Sun Apr 15 02:28:09 2007
New Revision: 123840

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123840
Log:
2007-04-14  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-04-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>

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



Added:
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/Wunused-value-2.c
      - copied unchanged from r122027,
trunk/gcc/testsuite/gcc.dg/Wunused-value-2.c
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/stmt.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-04-15  1:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-07 20:18 [Bug c/30729] New: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg pinskia at gcc dot gnu dot org
2007-02-07 20:24 ` [Bug c/30729] " pinskia at gcc dot gnu dot org
2007-02-09 22:10 ` pinskia at gcc dot gnu dot org
2007-02-14  9:22 ` [Bug middle-end/30729] " mmitchel at gcc dot gnu dot org
2007-02-16  1:19 ` pinskia at gcc dot gnu dot org
2007-02-16  1:20 ` [Bug middle-end/30729] [4.1/4.2 " pinskia at gcc dot gnu dot org
2007-02-19 21:05 ` mmitchel at gcc dot gnu dot org
2007-03-09 23:20 ` pinskia at gcc dot gnu dot org
2007-04-15  1:28 ` [Bug middle-end/30729] [4.1 " pinskia at gcc dot gnu dot org
2007-04-15  1:28 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).