Re: Comment on new INTENT paragraph

Jeff Squyres (jsquyres@lsc.nd.edu)
Tue, 13 May 1997 14:34:30 -0500 (EST)

On Tue, 13 May 1997, Dick Treumann wrote:

> Perhaps there would be a value to providing:
> int MPI_Send(const void *bufptr,.....
> if you have a smart enough C compiler to exploit the extra information.

Unfortunately not, since you have to cast away the (void *) anyway (you
can't use a (void *) to do anything -- it has to be cast to something else
before you can use it). So if you passed in (const void *), you'd have to
cast that away as well, so the (const) information is lost.

The real use for const is when passing in handles that will not change,
such as for IN arguments that are passed by reference, ala C++.

{+} Jeff Squyres
{+} squyres@cse.nd.edu
{+} Perpetual Obsessive Notre Dame Student Craving Utter Madness
{+} "I came to ND for 4 years and ended up staying for a decade"