-CR Command line switch and Firebird.pas

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

-CR Command line switch and Firebird.pas

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: -CR Command line switch and Firebird.pas

Jonas Maebe-3
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: -CR Command line switch and Firebird.pas

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


On 04/03/18 14:41, Jonas Maebe wrote:

> 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  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal