[Bug c/80806] gcc does not warn if local array is memset only

2023-07-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|10.5|---

[Bug c/80806] gcc does not warn if local array is memset only

2022-06-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|10.4|10.5

--- Comment #13 from Jakub Jelinek  ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

[Bug c/80806] gcc does not warn if local array is memset only

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Martin Sebor  changed:

   What|Removed |Added

   Assignee|msebor at gcc dot gnu.org  |unassigned at gcc dot 
gnu.org
 Status|ASSIGNED|NEW

--- Comment #12 from Martin Sebor  ---
I'm not working on this aspect anymore (though all the pieces are in place to
enable the warning).

[Bug c/80806] gcc does not warn if local array is memset only

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug c/80806] gcc does not warn if local array is memset only

2021-04-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|10.3|10.4

--- Comment #11 from Richard Biener  ---
GCC 10.3 is being released, retargeting bugs to GCC 10.4.

[Bug c/80806] gcc does not warn if local array is memset only

2020-07-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|10.2|10.3

--- Comment #10 from Richard Biener  ---
GCC 10.2 is released, adjusting target milestone.

[Bug c/80806] gcc does not warn if local array is memset only

2020-05-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|10.0|10.2

--- Comment #9 from Jakub Jelinek  ---
GCC 10.1 has been released.

[Bug c/80806] gcc does not warn if local array is memset only

2019-09-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Martin Sebor  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
   Target Milestone|--- |10.0

--- Comment #8 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01690.html

[Bug c/80806] gcc does not warn if local array is memset only

2017-08-11 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Martin Sebor  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=44108

--- Comment #7 from Martin Sebor  ---
My patch for this warning causes regressions in Wunused-var-8.c added for bug
44108.  As it turns out, GCC considers it a use of a variable even when it's
just mentioned in an unevaluated context (such as the sizeof expression in the
call to memset in comment #0), without being evaluated.

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-20 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

--- Comment #6 from Daniel Fruzynski  ---
I have checked list of my issues reported here and found Bug 68034 which is
closely related to this one. This patch probably will fix that one too, user
will know that his memset was removed by compiler.

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-19 Thread prathamesh3492 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
Patch posted for review:
https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01493.html

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

--- Comment #4 from Martin Sebor  ---
Right, const could be used in lieu of an "in" attribute for warnings.  It can't
be used for the same thing for optimization because constness can be cast away.
 Bug 10138 has a good discussion on the subject.

Let me see if I can prototype something.

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

--- Comment #3 from Daniel Fruzynski  ---
"in" attribute is similar to "const", I am not sure if we need another one for
this.

"out" attribute would be handy. I recall than in the past I was looking for it.
gcc can print warning that uninitialized variable is passed to function. Now
one has to initialize that variable before passing it to function. With this
attribute initialization would not be necessary. Beside silenced warning this
also would produce a bit faster executable.

BTW, C# provides "out" parameter modifier, but no "in".

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-18 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor  ---
The challenge is that the DECL_READ_P flag is set indiscriminately by the front
end (in convert_lvalue_to_rvalue called from c_parser_expr_list while parsing
the argument list in the function call expression) in response to seeing the
array being passed to a function as an argument.  There's no logic that would
take into account the properties of the function is being called.  In general,
GCC also has no notion of "out" only arguments (such as memset's first), or
"in" only (such as memcpy's second).  It may be a useful concept to introduce
in the form of an attribute.  With such an attribute, this issue could then be
detected in for any function whose arguments were decorated with it.

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-05-18
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.