This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Strange warning text
- From: Christoph Rabel <odie at hal9000 dot vc-graz dot ac dot at>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 23 Mar 2004 16:37:31 +0100
- Subject: Strange warning text
Hi!
Compiling the following program with -Wall
struct MyType{};
int main()
{
int size = 0;
int temp1[size];
}
I get the following warning:
x12.cpp: In function `int main()':
x12.cpp:6: warning: unused variable `int temp1[((size - 1) + 1)]'
I was rather surprised by "((size - 1) + 1)" part.
While this is a rather unimportant issue I would be interested to know
why 1 is subtracted and then added again. I see no sense in this and
really would like to get an explanation for this warning text.
Thx very much!
Christoph