Pelles C forum

Pelles C => Bug reports => Topic started by: Marco on January 22, 2021, 05:58:33 pm

Title: No warning about not referenced variables
Post by: Marco on January 22, 2021, 05:58:33 pm
Hello!

While compiling the source code of one of my programs, I noticed that the compiler did not warn me about some declared (but not referenced) 'char' variables. It's a very minor issue, but I don't know if it's a compiler bug or not. Anyway, to reproduce the issue, just declare a couple of never referenced 'char' variables like the following:

Code: [Select]
int n = 8;
char str1[8];     <== warning #2114: Local 'str1' is not referenced.
char str2[n];     <== no warning

During the compilation, the compiler will not warn about the 'str2' variable.

Marco
Title: Re: No warning about not referenced variables
Post by: TimoVJL on January 22, 2021, 07:27:46 pm
char str1[8]; is static
char str2[n]; isn't static, even n is
Title: Re: No warning about not referenced variables
Post by: Marco on January 22, 2021, 11:23:05 pm
char str1[8]; is static
char str2[n]; isn't static, even n is

Thanks Timo!