No warning for module global variable which is set but never used
webmaster
webmaster@defcon-cc.org
Thu Dec 10 15:10:08 GMT 2020
Is it possible to request such feature?
Am 09.12.2020 um 16:45 schrieb webmaster:
> I have the following Code C\C++:
>
> static int foo = 0;
>
> static void bar(void)
> {
> foo = 1;
> }
>
> Here it is clear for the compiler that the variable foo can only be
> accessed from the same modul and not from ther modules. From the
> explanations before I understand that the variable is removed due to
> optimization. But I do not understand why GCC does not throws a warning.
>
>>From my point of view it is responsibility of the developer to remove
> the unused variable.
>
More information about the Gcc
mailing list