[mpich-discuss] using mpi.h with C++ and warnings that result (ultra-pedantic)

Jeff Hammond jhammond at alcf.anl.gov
Sat Mar 2 08:28:02 CST 2013


On Sat, Mar 2, 2013 at 6:29 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Sat, Mar 2, 2013 at 6:51 AM, Dave Goodell <goodell at mcs.anl.gov> wrote:
>> On Mar 1, 2013, at 9:57 PM CST, Jeff Hammond wrote:
>>
>>> I apologize in advance for being ultra-pedantic.
>>>
>>> I am using MPI in a purely C++ code.  Is there a way to make this
>>> warning go away?  I know at least one MPICH developer who shares my
>>> disdain for compiler warnings, so I hope this isn't too unreasonable.
>>>
>>> Since I am using a C++ compiler, I can't exactly tell it to use C99 mode.
>>>
>>> /Users/jhammond/eclipse/MPICH2/trunk/install-clang/include/mpi.h:526:9:
>>> warning: 'long long' is an extension when C99 mode is not enabled
>>> [-pedantic,-Wlong-long]
>>> typedef long long MPI_Count;
>>
>> Don't compile with -pedantic.  It's almost never a useful flag.  Alternatively, add "-Wno-long-long" if you need other windmills to tilt at.
>
> I would argue that -pedantic is, in fact, a useful flag.  For example,
> LLVM and Clang are compiled with -pedantic, but we also add
> -Wno-long-long (and a few other flags) to disable warnings about
> extensions that are implemented virtually in every compiler.  And,
> LLVM and Clang have *zero* warnings when compiled with itself.

Is there a configure option that will cause MPICH to "typedef long
MPI_Count" instead?

I compile apps with -pedantic when I want to be absolutely certainly
that a non-standard language usage is causing an error.  I know MPICH
isn't the issue here but that doesn't mean that I don't aspire to
compile apps without any warnings.

Jeff


-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond



More information about the discuss mailing list