This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: revap types, step 1
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Ron Young <ronyoung at adelphia dot net>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 27 Aug 2004 14:36:10 +0200
- Subject: Re: revap types, step 1
- References: <KDEHIOGDKGKPNBLBLINJCEBPCEAA.ronyoung@adelphia.net>
Ron Young wrote:
> If a given machine is not byte addressable ,then
> logical*1,logical*4,integer*1,integer*2 and maybe integer*4 don't make
> since.
For integers this is not true at all: integer*1 is an integer with a range
[-128,127], no matter how many bytes you need to store them (IOW no matter how
memory accesses have to be aligned). This is functionality different from the
one integer*4 offers you.
Also, these datatypes might come in handy when using packed structure, i.e.
TYPE a
INTEGER*1 :: a
LOGICAL*1 :: b
INTEGER*2 :: c
END TYPE a
could be made to occupy 4 bytes of storage instead of 16, if wished. Access to
structure components would then of course have to happen in chunks of the
right alignment, but this wouldn't have to be great loss.
- Tobi