Please allow turning off warnings about uninitialized _strings_
Original Reporter info from Mantis: jetnexus
-
Reporter name: jetNexus Ltd.
Original Reporter info from Mantis: jetnexus
- Reporter name: jetNexus Ltd.
Description:
Auto strings are always intitialised to blank. In the vast majority of cases, this is fine. It is not even a potential bug to have a blank string in the vast number of cases. This warnign message seems to be used for ALL variables (ordinlas/atominc types) so cannot be turned off, but the vast number of string warnings makes it very hard to read the compiler output usefully.
Hint: Local variable "content" does not seem to be initialized
Please separate "uninitialised atom auto" warning message from the "preinitialised auto" warning message so that the latter can be suppressed alone.
Steps to reproduce:
program FpcBug1;
{$mode objfpc}{$H+}
uses
SysUtils;
var
trivial: string;
serious: integer;
begin
trivial := trivial + 'Hello world.';
WriteLn(trivial);
serious := serious + 1;
WriteLn(serious);
end.
Additional information:
Options changed, recompiling clean with -B
FpcBug1.lpr(12,14) Warning: Variable "trivial" does not seem to be initialized
FpcBug1.lpr(14,14) Warning: Variable "serious" does not seem to be initialized
Project "My Application" successfully built
Both warnings are of the same type and cannot be suppressed individually
Mantis conversion info:
- Mantis ID: 24601
- OS: All
- OS Build: All
- Platform: All
- Version: 2.6.2
- Fixed in version: 3.0.0
- Fixed in revision: 29295 (#4289dd66)
- Monitored by: » Vincent (Vincent Snijders)