[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2017-03-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33086 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2007-08-20 Thread manu at gcc dot gnu dot org
--- Comment #5 from manu at gcc dot gnu dot org 2007-08-20 14:47 --- Andrew, what about functions marked with attribute pure ? int atoi(const char *) __attribute__ ((pure)); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33086

[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2007-08-17 Thread manu at gcc dot gnu dot org
--- Comment #4 from manu at gcc dot gnu dot org 2007-08-17 10:15 --- (In reply to comment #3) void use(const int *a) { int *b = (int*)a; Andrew, you are right. I tend to forget how fragile is 'const', even in C++. So, then this is invalid and thus it is PR10138. --

[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2007-08-16 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-08-16 10:59 --- At least for languages where 'const' is actually enforced There is none, unless you are taking about fortran in arguments. So we need to mark such argument as special. Now if you have the full program (or at

[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2007-08-16 Thread pinskia at gcc dot gnu dot org
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||pinskia at gcc dot gnu dot |

[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2007-08-16 Thread manu at gcc dot gnu dot org
--- Comment #2 from manu at gcc dot gnu dot org 2007-08-16 11:19 --- (In reply to comment #1) At least for languages where 'const' is actually enforced There is none, void use(const int *a) { a[0] = 5; } void foo(void) { int i; use(i); } new.c:3: error: assignment of

[Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments

2007-08-16 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2007-08-16 14:58 --- void use(const int *a) { int *b = (int*)a; b[0] = 5; } void foo(void) { int i; use(i); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33086