On Wed, Oct 31, 2012 at 2:36 PM, Jeff Squyres <jsquy...@cisco.com> wrote: > On Oct 31, 2012, at 3:45 AM, Dmitri Gribenko wrote: > >>> With this patch, they'd get warnings about these uses, even though they are >>> completely valid according to MPI. >>> >>> A suggestion was that this functionality could be disabled by default, and >>> enabled with a magic macro. Perhaps something like: >> >> This is a vaild concern and a good idea for a FAQ entry. > > Can we flip the orientation such that -Wmpi-type-safety needs to be specified > to enable this behavior, rather than -Wno-mpi-type-safety is required to > disable it? (or the equivalent -D's) > > The rationale here is that correct MPI applications should not need to add > any extra compiler files to compile without warnings.
I would disagree with this. Compiler warnings are most useful when they are on by default. Only a few developers will turn on a warning because warnings are hard to discover and enabling a warning requires an explicit action from the developer. The pattern you described is an important one, but most MPI applications will have matching buffer types/type tags. Applications that use code like that can disable the warning or silence it. If the pattern you describe is extremely frequent, we could disable checking for 'char *' buffer type, just like for 'void *'. 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 <griboz...@gmail.com>*/