[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2020-06-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Martin Sebor changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2020-06-04 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 --- Comment #30 from CVS Commits --- The master branch has been updated by Martin Sebor : https://gcc.gnu.org/g:b825a22890740f341eae566af27e18e528cd29a7 commit r11-959-gb825a22890740f341eae566af27e18e528cd29a7 Author: Martin Sebor Date: Thu

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2020-05-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Martin Sebor changed: What|Removed |Added Keywords||patch Last reconfirmed|2008-03-30

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2019-09-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Martin Sebor changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2017-03-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Bug 10138 depends on bug 33086, which changed state. Bug 33086 Summary: warn for read-only uninitialized variables passed as arguments https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33086 What|Removed |Added

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2017-03-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 --- Comment #27 from Martin Sebor --- *** Bug 33086 has been marked as a duplicate of this bug. ***

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2016-09-06 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 --- Comment #26 from Martin Sebor --- It seems that it should be possible to enhance the warn_uninitialized_vars function in tree-ssa-uninit.c to detect this case by iterating over a callee's arguments and warn on uninitialized variables whose

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2016-09-06 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2016-02-23 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Manuel López-Ibáñez changed: What|Removed |Added CC||developm...@faf-ltd.com ---

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2015-08-12 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138 Bug 10138 depends on bug 27120, which changed state. Bug 27120 Summary: Should warn about uninitialized use of variable array element https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27120 What|Removed |Added

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2009-12-30 Thread matt at use dot net
--- Comment #23 from matt at use dot net 2009-12-31 01:44 --- I just ran into a bug that this feature would have found for me at compile-time. Instead, it required exercising the code under valgrind, which took quite some time. If voting were enabled, I would vote for this bug. --

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #10 from manu at gcc dot gnu dot org 2007-08-20 14:49 --- I now think that Andrew is right and that PR33086 and this one are INVALID. 'const' does not mean read-only in C++ at all, and much less in C. atoi(const char *) could always initialize buf[]. However, perhaps it can

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread bangerth at dealii dot org
--- Comment #11 from bangerth at dealii dot org 2007-08-20 14:56 --- (In reply to comment #10) I now think that Andrew is right and that PR33086 and this one are INVALID. 'const' does not mean read-only in C++ at all, and much less in C. atoi(const char *) could always initialize

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #12 from manu at gcc dot gnu dot org 2007-08-20 15:03 --- (In reply to comment #11) (In reply to comment #10) I now think that Andrew is right and that PR33086 and this one are INVALID. 'const' does not mean read-only in C++ at all, and much less in C. atoi(const

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #13 from manu at gcc dot gnu dot org 2007-08-20 15:08 --- (In reply to comment #12) This testcase has nothing to do with uninitialized variables. If the variable is 'const' already, then there will never be a warning. Will it produce segmentation fault for a local

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread bangerth at dealii dot org
--- Comment #14 from bangerth at dealii dot org 2007-08-20 15:54 --- (In reply to comment #12) This testcase has nothing to do with uninitialized variables. No, of course. I only meant to reply to your assertion that there could be cases where a function initializes an object that is

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #15 from manu at gcc dot gnu dot org 2007-08-20 16:15 --- (In reply to comment #14) This is meant to only counter your point that: 'const' does not mean read-only in C++ at all, and much less in C. atoi(const char *) could always initialize buf[]. This simply isn't

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread bangerth at dealii dot org
--- Comment #16 from bangerth at dealii dot org 2007-08-20 16:21 --- (In reply to comment #15) Of course, the output is '5' and not '0'. So yes, atoi() seems perfectly able to initialize buf. (or perhaps, I am still confused). I think you are. This program here segfaults:

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #17 from manu at gcc dot gnu dot org 2007-08-20 16:44 --- (In reply to comment #16) (In reply to comment #15) Of course, the output is '5' and not '0'. So yes, atoi() seems perfectly able to initialize buf. (or perhaps, I am still confused). Since use() (like

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #18 from manu at gcc dot gnu dot org 2007-08-20 16:46 --- When I say constant are not propagated I mean the constant value of a variable such as: int i=0; use(i); foo(i); Here, GCC does not propagate the value of i to do foo(0). Remove the call to use and then it

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread bangerth at dealii dot org
--- Comment #19 from bangerth at dealii dot org 2007-08-20 16:58 --- (In reply to comment #18) When I say constant are not propagated I mean the constant value of a variable such as: int i=0; use(i); foo(i); Here, GCC does not propagate the value of i to do foo(0).

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #20 from manu at gcc dot gnu dot org 2007-08-20 17:12 --- (In reply to comment #19) What if you had const int i=0? As I said before, use() may do a const-cast to get rid of the constness of its argument, but the result is only well-defined if the object pointed to is

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread gdr at cs dot tamu dot edu
--- Comment #21 from gdr at cs dot tamu dot edu 2007-08-20 18:50 --- Subject: Re: warn for uninitialized arrays passed as const* arguments manu at gcc dot gnu dot org [EMAIL PROTECTED] writes: | When I say constant are not propagated I mean the constant value of a | variable such as:

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-20 Thread h dot b dot furuseth at usit dot uio dot no
--- Comment #22 from h dot b dot furuseth at usit dot uio dot no 2007-08-20 22:45 --- Subject: Re: warn for uninitialized arrays passed as const* arguments manu at gcc dot gnu dot org writes: But it seems that the current policy of GCC is to not assume that such functions actually

[Bug middle-end/10138] warn for uninitialized arrays passed as const* arguments

2007-08-16 Thread manu at gcc dot gnu dot org
--- Comment #9 from manu at gcc dot gnu dot org 2007-08-16 10:57 --- Let's simplify this report. This one is now about int atoi(const char *); int foo() { char buf[10]; return atoi(buf); } As comment #3 mentions, this is a combination of 1) Report use of uninitialized array