[cfe-commits] [PATCH] Compile-time MPI_Datatype checking, type arguments in attributes

Dmitri Gribenko gribozavr at gmail.com
Sun Feb 12 05:07:24 PST 2012


On Sun, Feb 12, 2012 at 2:33 PM, Matthieu Monrocq
<matthieu.monrocq at gmail.com> wrote:
> Le 11 février 2012 21:09, Dmitri Gribenko <gribozavr at gmail.com> a écrit :
>> mpi_typed_arg(buffer-arg-index, type-arg-index) attribute:
>>
>> int MPI_Send(void *buf, int count, MPI_Datatype datatype, ...etc...)
>>    __attribute__(( mpi_typed_arg(1,3) ));
>
> Just a small remark here: indexes in C and C++ are usually 0-based, while
> counting is 1-based. To avoid the ambiguity altogether it would be even
> simpler to use the *names* of the arguments rather than their position, it
> seems to be it would also be slightly easier to read and maintain.

I completely agree with you, specifying names would be much more
user-friendly.  I decided to use indexes only because of consistency
with format attribute, which looks much the same.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the cfe-commits mailing list