<div class="gmail_quote">On Wed, Jun 27, 2012 at 11:59 AM, N.M. Maclaren <span dir="ltr"><<a href="mailto:nmm1@cam.ac.uk" target="_blank">nmm1@cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":mp">It's not the compiler that is the issue, because MPI needs only the C<br>
facilities that are available in the C subset of C++. </div></blockquote><div><br></div><div>But C (90 or otherwise) isn't a subset of C++, though I don't see it being relevant.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":mp"> It's what is defined<br>
in the various standards.<br>
<br>
I was hoping to get time to respond in a more carefully thought-out message,<br>
but am in a WG5 meeting, so this is in haste.<br>
<br>
Using C99 is NOT a solution, largely because the requirement is for use<br>
from C++ and std::complex and std::bool do not have equivalents in C99<br>
(_Complex ,and _Bool are semantically different, and are not required to<br>
match those. </div></blockquote><div><br></div><div>So in C++ sizeof(bool) is not required to be 1. It's not clear to me whether the integer rank inequalities in C99 require it to be equal to 1 (like char). In either case, there is no guarantee that these have the same size, thus we seem to need a MPI_CXX_BOOL for completeness (though no science will ever be impeded by lack of support for bool).</div>
<div><br></div><div>It is certainly the case that C99 _Complex has the same data representation as the corresponding std::complex type, cf. C99 6.2.5.13 and C++11 26.4 paragraph 4. Note that MPI does not care about differences in conversion semantics that account for the most commonly encountered incompatibilities between C99 and C++ types.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":mp"> Also, the required language is C90, because C++03 inherits<br>
from it, and C99 has been rejected (for VERY good reasons) by about half<br>
of the C-using communities.<br>
<br>
While C++11 nominally inherits from C99, it has not included _Complex or<br>
_Bool, and has kept a lot of C90 semantics in cases where C99 and C90 are<br>
incompatible.  Most of those don't affect this, but one aspect does.<br>
<br>
Someone mentioned that C99 _Complex has better semantics than std::complex.<br>
I am afraid that is the converse of the truth, especially when you bring<br>
in the utterly appalling Annex G.</div></blockquote><div><br></div><div>What is the problem with Annex G (which is not normative)? C++ doesn't specify anything in particular, nor even suggest that division ought to be implemented in a stable way.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":mp">  C++11 has included the function calls<br>
for IEEE 754 support, but neither the pragmas nor the semantics, and the<br>
combination is therefore totally undefined.<br></div></blockquote><div><br></div><div>Sure, so C99 semantics conform to C++ requirements because C++ doesn't bother specifying anything.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":mp">
<br>
Yes, this is an ungodly mess.  I don't agree with the forum's decision,<br>
but let's accept it.  The only reasonable approach is the one of having<br>
MPI types for C++'s types, which could still be used via the C interface<br>
from a C++ compiler.  I believe that is what you were referring to, and<br>
what is intended.</div></blockquote></div><br><div>As in my first email, I think that MPI_CXX_COMPLEX et al should be defined, but I haven't seen anything to indicate that an implementation would not be able to simply make them aliases to MPI_C_COMPLEX.</div>