Difference between revisions of "Talk:Avoiding implicit try finally section"

From Free Pascal wiki
Jump to navigationJump to search
(Moved Plugwash suggestion from "article" to "discussion", my answer given)
Line 1: Line 1:
 
Do you know in which cases an implicit try .. finally blockl is created?
 
Do you know in which cases an implicit try .. finally blockl is created?
 
:its any time the compiler needs it. basically if you use any type which needs compiler magic cleanup. ansitrings,variants,com style interaces,resourcestrings.
 
:its any time the compiler needs it. basically if you use any type which needs compiler magic cleanup. ansitrings,variants,com style interaces,resourcestrings.
 +
 +
(This was added by Plugwash to "article" page, Michalis only moved it to "discussion" page). maybe the compier developers could add an option to generate a warning when an implicit try-finally is inserted
 +
 +
:I'm not FPC developer, but I don't think such warning would be useful. There are just too many cases when implicit try-finally section must be added, so such warning would be displayed very very often, making it quite useless. As Peter Vreman suggested on fpc-devel mailing list, one can always look at generated assembler code (compile with -al) to see when this happens. [[User:Michalis|Michalis]]
 +
 +
As a sidenote: let's sign up contributions to "discussion" page (write three ~ characters to get your username automatically inserted). This helps readers to understand who is saying what, without constantly looking at "history" page. [[User:Michalis|Michalis]]

Revision as of 22:47, 4 January 2005

Do you know in which cases an implicit try .. finally blockl is created?

its any time the compiler needs it. basically if you use any type which needs compiler magic cleanup. ansitrings,variants,com style interaces,resourcestrings.

(This was added by Plugwash to "article" page, Michalis only moved it to "discussion" page). maybe the compier developers could add an option to generate a warning when an implicit try-finally is inserted

I'm not FPC developer, but I don't think such warning would be useful. There are just too many cases when implicit try-finally section must be added, so such warning would be displayed very very often, making it quite useless. As Peter Vreman suggested on fpc-devel mailing list, one can always look at generated assembler code (compile with -al) to see when this happens. Michalis

As a sidenote: let's sign up contributions to "discussion" page (write three ~ characters to get your username automatically inserted). This helps readers to understand who is saying what, without constantly looking at "history" page. Michalis