Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-12 Thread Jürgen Hestermann
Am 2015-03-10 um 17:40 schrieb Sven Barth: It mutes the warning with the ID 5089 (the ID can be seen with -vq). So as long as the managed and unmanaged ones use the same warning ID (AFAIR they do) they will both be silenced. Ups, no, they are different. So at least if you use a current 2.7.1

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-11 Thread Jürgen Hestermann
Am 2015-03-10 um 18:52 schrieb Florian Klämpfl: Using dyn. arrays without initialization makes litte sense in real world programs, Why this? I do this all the time. I know that they *are* already initialized so why should I do this again? so those warnings have their use. Of what use are

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Jürgen Hestermann
Am 2015-03-09 um 19:24 schrieb DaWorm: I would think this part answers that question: The warning means that no value has been */explicitly/* assigned to these variables (which */may indicate a logic error/* in the code), not necessarily that they contain an unpredictable value. (emphasis

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Lukasz Sokol
On 10/03/15 09:08, Mattias Gaertner wrote: On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol el.es...@gmail.com wrote: On 10/03/15 06:10, Jürgen Hestermann wrote: [...] Why not simply omit these messages (for managed types)? Just because YOU don't need it, doesn't mean it's useless for

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Mattias Gaertner
On Tue, 10 Mar 2015 12:04:37 + Lukasz Sokol el.es...@gmail.com wrote: [...] For example in Lazarus 1.3+ you can right click the message and click on Hide with project option (-vm5089). Cool, but probably not what I meant ;) as this hides it project-wide ? Yes. I guess that is what

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Sven Barth
Am 10.03.2015 13:05 schrieb Lukasz Sokol el.es...@gmail.com: On 10/03/15 09:08, Mattias Gaertner wrote: On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol el.es...@gmail.com wrote: On 10/03/15 06:10, Jürgen Hestermann wrote: [...] Why not simply omit these messages (for managed types)?

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Sven Barth
Am 10.03.2015 17:36 schrieb Sven Barth pascaldra...@googlemail.com: Am 10.03.2015 17:25 schrieb Jürgen Hestermann juergen.hesterm...@gmx.de : Am 2015-03-10 um 10:08 schrieb Mattias Gaertner: On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol el.es...@gmail.com wrote: On 10/03/15

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Lukasz Sokol
On 10/03/15 13:54, Sven Barth wrote: I mean, it's good to have this warning enabled by default and only suppress it around code that /I/ know it's bogus at. Otherwise, it /really/ wouldn't serve its purpose of pointing where a PEBKAC^WLOGIC ERROR may occur... Sort of like surround the

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Mattias Gaertner
On Tue, 10 Mar 2015 18:08:14 +0100 Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Am 2015-03-10 um 17:40 schrieb Sven Barth: It mutes the warning with the ID 5089 (the ID can be seen with -vq). So as long as the managed and unmanaged ones use the same warning ID (AFAIR they do) they

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Lukasz Sokol
On 10/03/15 16:08, Jürgen Hestermann wrote: Am 2015-03-10 um 09:48 schrieb Lukasz Sokol: On 10/03/15 06:10, Jürgen Hestermann wrote: Am 2015-03-09 um 19:24 schrieb DaWorm: I would think this part answers that question: The warning means that no value has been */explicitly/* assigned to

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Jürgen Hestermann
Am 2015-03-10 um 18:16 schrieb Lukasz Sokol: On 10/03/15 16:08, Jürgen Hestermann wrote: Then please tell me, what do you (or anybody else) gain from this warning? Especially, as it claims something that is definitely not true (for managed types). It may even misguide some to add

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Lukasz Sokol
On 10/03/15 16:08, Jürgen Hestermann wrote: Am 2015-03-10 um 09:48 schrieb Lukasz Sokol: On 10/03/15 06:10, Jürgen Hestermann wrote: Am 2015-03-09 um 19:24 schrieb DaWorm: I would think this part answers that question: The warning means that no value has been */explicitly/* assigned to

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Florian Klämpfl
Am 10.03.2015 um 18:43 schrieb Jürgen Hestermann: Am 2015-03-10 um 18:16 schrieb Lukasz Sokol: On 10/03/15 16:08, Jürgen Hestermann wrote: Then please tell me, what do you (or anybody else) gain from this warning? Especially, as it claims something that is definitely not true (for managed

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Jürgen Hestermann
Am 2015-03-10 um 09:48 schrieb Lukasz Sokol: On 10/03/15 06:10, Jürgen Hestermann wrote: Am 2015-03-09 um 19:24 schrieb DaWorm: I would think this part answers that question: The warning means that no value has been */explicitly/* assigned to these variables (which */may indicate a logic

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Jürgen Hestermann
Am 2015-03-10 um 10:08 schrieb Mattias Gaertner: On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol el.es...@gmail.com wrote: On 10/03/15 06:10, Jürgen Hestermann wrote: [...] Why not simply omit these messages (for managed types)? Just because YOU don't need it, doesn't mean it's useless for

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Sven Barth
Am 10.03.2015 17:25 schrieb Jürgen Hestermann juergen.hesterm...@gmx.de: Am 2015-03-10 um 10:08 schrieb Mattias Gaertner: On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol el.es...@gmail.com wrote: On 10/03/15 06:10, Jürgen Hestermann wrote: [...] Why not simply omit these messages (for

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Le Duc Hieu
From my observation while debugging, local variable inside procedure/functions usually contains garbage value (not initialized).

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Lukasz Sokol
On 10/03/15 06:10, Jürgen Hestermann wrote: Am 2015-03-09 um 19:24 schrieb DaWorm: I would think this part answers that question: The warning means that no value has been */explicitly/* assigned to these variables (which */may indicate a logic error/* in the code), not necessarily that

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-10 Thread Mattias Gaertner
On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol el.es...@gmail.com wrote: On 10/03/15 06:10, Jürgen Hestermann wrote: [...] Why not simply omit these messages (for managed types)? Just because YOU don't need it, doesn't mean it's useless for everybody...

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jürgen Hestermann
Am 2015-03-09 um 18:31 schrieb Jonas Maebe: On 09 Mar 2015, at 17:49, Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Am 2015-03-09 um 17:40 schrieb Jonas Maebe: http://bugs.freepascal.org/view.php?id=24601#c75617 (and the comment below + use -vq to see warning numbers, and -vm to

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jürgen Hestermann
Am 2015-03-09 um 17:40 schrieb Jonas Maebe: On 09 Mar 2015, at 17:25, Jürgen Hestermann wrote: I get a warning that a local dynamic array variable is not initialized. Aren't such managed types initialized by default? On http://wiki.freepascal.org/Dynamic_array it says: Actually, dynamic

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jonas Maebe
On 09 Mar 2015, at 17:49, Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Am 2015-03-09 um 17:40 schrieb Jonas Maebe: http://bugs.freepascal.org/view.php?id=24601#c75617 (and the comment below + use -vq to see warning numbers, and -vm to block a particular warning number).

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread DaWorm
I would think this part answers that question: The warning means that no value has been *explicitly* assigned to these variables (which *may indicate a logic error* in the code), not necessarily that they contain an unpredictable value. (emphasis mine) Jeff.

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jonas Maebe
On 09 Mar 2015, at 17:25, Jürgen Hestermann wrote: I get a warning that a local dynamic array variable is not initialized. Aren't such managed types initialized by default? On http://wiki.freepascal.org/Dynamic_array it says: Actually, dynamic arrays are pointers with automatic