Sign in Join

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

Mailing lists / fpc-pascal / 2018-03

-CR Command line switch and Firebird.pas

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Tony Whyman

Is there anyway of turning off the command line switch -CR (Verify object method call validity) on a per unit basis in the same way that -Cr (range checking) can be turned off using {$R-}? I can't see any such directive in the FPC documentation.

As the title suggests, I have a specific problem in mind with the Firebird.pas file distributed with the Firebird source code. The code in this unit maps a C++ vtable into Pascal method calls (its not nice but it works). Not surprisingly when a program is compiled with -CR you always get a runtime error when a call is made to the Firebird 3 API, It ain't a Pascal vtable and whatever test the compiler uses fails.

I don't see a way around the Firebird.pas approach for calling the Firebird 3 API from a Pascal program and if there is no way of turning off this check on a per unit basis the -CR switch is probably unusable with any program that uses the Firebird 3 API.

Tony Whyman

MWA

Reply by email

Jonas Maebe
to Tony Whyman
Tony Whyman wrote
Is there anyway of turning off the command line switch -CR (Verify object method call validity) on a per unit basis in the same way that -Cr (range checking) can be turned off using {$R-}? I can't see any such directive in the FPC documentation.
{$OBJECTCHECKS off}

Jonas

Reply by email

Tony Whyman
to Jonas Maebe

Many thanks - not the most obvious of switch names - but it works.

Jonas Maebe wrote 14 lines
On 04/03/18 15:38, Tony Whyman wrote: > Is there anyway of turning off the command line switch -CR > (Verify object method call validity) on a per unit basis in the same > way that -Cr (range checking) can be turned off using {$R-}? I can't > see any such directive in the FPC documentation. {$OBJECTCHECKS off} Jonas _______________________________________________ fpc-pascal maillist  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email