Hi Davide,

On 2009-11-12 10:22, Davide Cesari wrote:
> Hi Arjen,
> 
> Arjen Markus ha scritto:
>> Hi Davide, Hazen,
>>
>> yes, g77 is complaining because of the "implicit none" statements.
>> I have now added "external floor" and "real*8 floor", so the error
>> messages are gone.
>>
>> The second (warning) message is about calling plslabelfunc with a
>> literal 0, rather than a procedure name. gfortran ignores this,
>> but g77 gives a warning. I am not sure how to proceed here - I
>> will look into it later on.
> 
> Apart from being a warning, this will probably not work because a 
> literal 0 means passing a pointer to a zero value, not a NULL pointer, 
> so the C will see it as a valid pointer and try to call it with 
> unpredictable results. I think there is no clean, portable way to pass a 
> null pointer in f77; the only solution in my view here -ugly, I agree- 
> if f77 support has to be maintained, is to change the API for fortran 
> and do some kind of plslabeldisablefunc() or something like that.
> In f90 it can be done cleanly by defining an interface to 2 subroutines, 
> one receiving a procedure and one receiving an integer, the second can 
> then call a C wrapper passing the null pointer, something similar is 
> done in f90gl for glutNullFunc (see: http://math.nist.gov/f90gl/ )
>     Hope this helps, Davide
> 

Actually, that is a very good point! The current Fortran 95 bindings do
not take care of this properly either. I will implement your suggestion.

For the F77 bindings we can not do anything like that, except to check
whether the _literal_ value at the address is zero (though it may not
be legal to take the _value_ of an address that is actually a function
pointer ...)

Regards,

Arjen

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to