From owner-sc22wg5@open-std.org  Fri Nov 13 21:05:51 2009
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id 7C76EC178E4; Fri, 13 Nov 2009 21:05:51 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from mail1.cray.com (mail1.cray.com [136.162.62.100])
	by www2.open-std.org (Postfix) with ESMTP id 8A437C178E2
	for <sc22wg5@open-std.org>; Fri, 13 Nov 2009 21:05:49 +0100 (CET)
Received: from beaver.us.cray.com (beaver.us.cray.com [172.30.74.51])
	by mail1.cray.com (8.13.6/8.13.3/gw-5323) with ESMTP id nADK5lQJ004007
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);
	Fri, 13 Nov 2009 14:05:47 -0600 (CST)
Received: from cfexcas02.americas.cray.com (cfexcas02-2.us.cray.com [172.30.74.228])
	by beaver.us.cray.com (8.13.8/8.13.3/hub-5273) with ESMTP id nADK5kVp005695;
	Fri, 13 Nov 2009 14:05:46 -0600
Received: from cf-vpn-192-168-239-70.us.cray.com (192.168.239.70) by
 cfexcas02.americas.cray.com (172.30.74.226) with Microsoft SMTP Server (TLS)
 id 8.1.393.1; Fri, 13 Nov 2009 14:05:45 -0600
Message-ID: <4AFDBC1D.8040505@cray.com>
Date: Fri, 13 Nov 2009 14:05:49 -0600
From: Bill Long <longb@cray.com>
Reply-To: <longb@cray.com>
Organization: Cray Inc.
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
MIME-Version: 1.0
To: fortran standards email list for J3 <j3@j3-fortran.org>
Cc: WG5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.4126) Problems created by some compiler extended
 size options
References: <31F0E6B7-DFAE-4E3D-BA8F-21EDAA094A97@mac.com> <20091113192536.4F805C178E2@www2.open-std.org>
In-Reply-To: <20091113192536.4F805C178E2@www2.open-std.org>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit
X-Cray-VirusStatus: clean
Sender: owner-sc22wg5@open-std.org
Precedence: bulk



Craig Rasmussen wrote:
> There was a discussion at the MPI forum regarding the use of extended  
> size compiler options.  It appears that there some options on some  
> compilers that promote integers even if the kind parameter is specified.
> 
> The problem with this is that it breaks the C interoperability  
> standard.  For example, the code,
> 
>        integer(C_INT) :: i
>        call bindc_function(i)
> 
> appears to be broken as the variable i will get promoted.

I would hope not, assuming the dummy is declared integer(c_int).  Such 
'promotion' is really 'convert to the KIND of the dummy'.  Since bind(c) 
procedures must have explicit interfaces, the KIND of the dummy is 
visible.   If a compiler blindly converts integers to a particular KIND 
even when it is obvious that it would result in a kind mismatch, then 
that is indeed evil, and grounds for filing a big.

Cheers,
Bill


> 
> Is this a common compiler option?  I've been told that users most  
> often chose the compiler option that promotes everything, even if an  
> explicit kind is provided.
> 
> I think this practice is evil!
> 
> -craig
> 
> _______________________________________________
> J3 mailing list
> J3@j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

-- 
Bill Long                                           longb@cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101


