[Mpi-22] Ticket #46: Add const Keyword to the C bindings-implementation

Erez Haba erezh at [hidden]
Fri Mar 20 16:52:45 CDT 2009



There was some confusion about what exactly I implemented in those 2.5h in the last forum meeting and how I implemented it.   I would like to clarify this confusion and assure you that I am no super-dev of any sort.

What I did was simple, I walked all the functions in mpi.h and added (copied) the const from ticket #45. There was scripting, awk or perl involved it was all manual. Once I was done with the header I compiled; the compiler gave me a bunch of errors, saying that the impl does not match the function prototype. In my environment I can quickly go from a compiler error to the source code.
I fixed the MPI function impl to copy the same const to the function parameter and compiled again.  The compiler gave me a bunch of other errors about internal functions and/or variable assignment. Again I fixed those and recompiled. In very few places I had to do something sophisticated like casting, or changing a local pointer variable to be a pointer to a const. that's it! I repeated that process until I had no errors.

Indeed that was just a proof of concept; I used only one compiler in that case and only one platform. Which is why it was only 2.5h, and which is why it took longer (2d) for Pavan to implement over multiple compilers, platforms, test and submit it to the branch.

Hope that this helps,
.Erez



More information about the Mpi-22 mailing list