[fpc-devel] "unused variable" depends on optimization?
Martin Frb
lazarus at mfriebe.de
Sun Feb 23 14:26:30 CET 2025
On 23/02/2025 14:16, Jonas Maebe via fpc-devel wrote:
> On 23/02/2025 14:14, Martin Frb via fpc-devel wrote:
>> Is it correct (i.e. by design) that the compiler emits some "may not
>> be initialized" warnings, only on certain optimization levels?
>
> Yes. Those warnings depends on data flow analysis, which is only
> enabled by defaullt at -O3 and higher. You can also enabled it
> separately with -Oodfa.
Ok, so without dfa it does not omit the warning, probably because it has
see that there was a conditional initialization? (i.e. might be ok, at
least sometimes, even if certainly not always)
Meaning -O1 is lenient in its checks, because they are not as evolved.
More information about the fpc-devel
mailing list