[fpc-pascal] Warning message for constructing an abstract class

Sven Barth pascaldragon at googlemail.com
Wed Jul 2 21:45:01 CEST 2014


On 01.07.2014 22:50, Sven Barth wrote:
> Hello together!
>
> In revision 28127 I've commited the addition of a warning message when
> constructing an abstract class (declared as "class abstract(...) ...
> end"). Previously the compiler did not acknowledge that flag in any way
> (except for the JVM target) and so I thought it was time to add an
> approbiate message. This message is however not enabled by default, but
> you can do that by either doing a
>
> {$warn 4122 on}
>
> or
>
> {$warn 4122 error}
>
> depending on the severity you want the message to have.

After a little discussion we decided to enable the warning by default, 
so {$warn 4122 on} is not necessary. Additionally I have hooked up the 
message to the "constructing_abstract" identifier which also controlled 
the message if a class with an abstract method is instantiated. So you 
can now control both messages at once by using {$warn 
constructing_abstract error}.

Regards,
Sven




More information about the fpc-pascal mailing list