Alexander Barth wrote:
> On Fri, Jun 5, 2009 at 9:20 PM, David Bateman<dbate...@dbateman.org> wrote:
>   
>> Why not just use
>> octave_idx_type if the fortran logical index is 8bit with --enable-64?
>>
>>     
>
> This is in the end what I did, but I declared a macro
> octave_f77_bool_type defined as octave_idx_type.
>
> The underlying assumption is that the Fortran compiler uses the same
> amount of bytes for INTEGER and LOGICAL. I would prefer to "hide" this
> assumption behind a macro since there might be some Fortran compilers
> that handle things differently. (After all, it is quite wasteful to
> allocate 8 bytes for a variable with only two states).
>
> I looked a bit around how the different Fortran compilers handle the
> size of LOGICALs. For gfortran (with and without  -fdefault-integer-8)
> and ifort (with and without -i8), the size of LOGICALs will always be
> the size of INTEGER. However, with pgf90, the compiler option -i8,
> leaves the size of LOGICALs to 4 bytes. Only the option -i8storage
> allocates 8 bytes for INTEGER and LOGICAL.
>
> This reminds me also a bit of the assumption that size of a pointer
> will always be the same as the size of an int in C. Such assumption is
> the classical problem when porting a program to 64-bit CPU.
>
> Cheers,
> Alex
>   
Grrr, then we need an autoconf test that probes the number of bytes in a 
fortran logical type and sets your macro appropriately...

D.

-- 
David Bateman                                dbate...@dbateman.org
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to