Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-08

deprecated keyword

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi

FPC seems to allow the 'deprecated' keyword after a method declaration, but what exactly does the compiler do with that keyword? I don't see any special messages or anything from the compiler.

I think at compile time the compiler should raise a warning wherever that deprecated method is used somewhere.

The deprecated keyword could be used in frameworks or libraries designed with Free Pascal and that get maintained over many years. As code evolves, things change. I think this will be very handy for developers giving them a early warning to update their code without breaking it.

Just my thoughts...

Regards,
- Graeme -

Reply by email

Peter Vreman
to Graeme Geldenhuys
Show quoted text 14 lines
Hi FPC seems to allow the 'deprecated' keyword after a method declaration, but what exactly does the compiler do with that keyword? I don't see any special messages or anything from the compiler. I think at compile time the compiler should raise a warning wherever that deprecated method is used somewhere. The deprecated keyword could be used in frameworks or libraries designed with Free Pascal and that get maintained over many years. As code evolves, things change. I think this will be very handy for developers giving them a early warning to update their code without breaking it.
The compiler should emit a warning when the identifier is used. If it doesn't then it is a bug.
Example output: dos.pp(407,57) Warning: Symbol "StatFS" is deprecated

Peter

Reply by email

Graeme Geldenhuys
to Peter Vreman
Peter Vreman wrote
The compiler should emit a warning when the identifier is used. If it doesn't then it is a bug. Example output: dos.pp(407,57) Warning: Symbol "StatFS" is deprecated

My mistake sorry. I double checked by modifying my test a little and it _does_ work and exactly what I wanted. Damn you guys are good!! :-)

Graeme.

Reply by email