[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [mpi-21] MPI::BOTTOM
- To: mpi-21@xxxxxxxxxxxxx
- Subject: Re: [mpi-21] MPI::BOTTOM
- From: Jeff Squyres <jsquyres@xxxxxxxxx>
- Date: Wed, 28 Nov 2007 11:28:52 -0500
- Authentication-results: rtp-dkim-1; header.From=jsquyres@cisco.com; dkim=pass ( sig from cisco.com/rtpdkim1001 verified; );
- Delivered-to: mpifrm-mpi-21-outgoing@mailbouncer.mcs.anl.gov
- Delivered-to: mpifrm-mpi-21@mailbouncer.mcs.anl.gov
- Dkim-signature: v=0.5; a=rsa-sha256; q=dns/txt; l=1144; t=1196267373; x=1197131373; c=relaxed/simple; s=rtpdkim1001; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=jsquyres@cisco.com; z=From:=20Jeff=20Squyres=20<jsquyres@cisco.com> |Subject:=20Re=3A=20[mpi-21]=20MPI=3A=3ABOTTOM |Sender:=20 |To:=20mpi-21@mpi-forum.org; bh=vsZg/HtdtwyJZKLbDbxlgSlBIPmRf6aggR6lmI4W4q8=; b=hq0MEQHN83xjK6YYcOkAzJZ+PtHpcGH1HTgg2bB/XKrqxxiRzwazAbKhc6SmmpBbxicSZZhi +GPrHAZXLjsgf7ZFSuUur8FhxIb/BVWb8/hocVE4mV9IxS1phgnhmOVI;
- In-reply-to: <264DF29C-68F5-40E2-A6C0-C3247A8EC9D0@mcs.anl.gov>
- References: <6E1DC9E5-FE72-4961-9780-D84AF65DBF1E@cisco.com> <264DF29C-68F5-40E2-A6C0-C3247A8EC9D0@mcs.anl.gov>
- Reply-to: mpi-21@xxxxxxxxxxxxx
- Sender: owner-mpi-21@xxxxxxxxxxxxx
On Nov 27, 2007, at 5:40 PM, Dave Goodell wrote:
"const TYPE * FOO" indicates that the data pointed to by FOO is read-
only. So "*FOO = BAR;" would be an illegal statement.
"TYPE * const FOO" indicates that the memory holding the value of
FOO is read-only. So "FOO = &BAR;" would be an illegal statement.
The latter seems to be what is desired for MPI::BOTTOM: an address
that cannot be changed but a the data that it references can.
Good point. I think you're right -- I ran a few tests to convince
myself that changing the type of MPI::BOTTOM to (void * const) won't
break anything in terms of the other existing bindings.
However, in terms of what MPI::BOTTOM *should* be, shouldn't it be
*both* consts? We don't want the value to change, nor do we want the
pointed-to- contents where it points to change:
extern const void * const BOTTOM;
Technically, though, with your suggestion, you couldn't change the
pointed-to contents without casting anyway (because you can't assign
to *(void*)). So this might be a good enough solution.
--
Jeff Squyres
Cisco Systems