<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div><div dir="auto">MPI-3 added const in a bunch of places while also deleting the C++ bindings so these issues are not surprising. They’re also innocuous and should be ignored. If they bother you too much, they are very easy to fix and I’m sure a patch would be appreciated.</div><div dir="auto"><br></div><div dir="auto">Jeff</div><br><div class="gmail_quote"><div>On Sun, Oct 22, 2017 at 7:39 AM Vincent Bode <<a href="mailto:vincent@jd-bode.de">vincent@jd-bode.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="#0563C1" vlink="#954F72"><div class="m_-7588226795307540661WordSection1"><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">Dear MPICH Discuss,<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">When compiling a program that includes the header mpi.h with the GCC Compiler option –Wcast-qual several compiler warnings occur in mpicxx.h:<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">In file included from /usr/include/mpich/mpi.h:2231:0,<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> /usr/include/mpich/mpicxx.h: In member function ‘virtual void MPI::Datatype::Set_attr(int, const void*)’:<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> /usr/include/mpich/mpicxx.h:335:90: warning: cast from type ‘const void*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> MPIX_CALLWORLD( MPI_Type_set_attr( (MPI_Datatype) the_real_datatype, v2, (void *)v3 ));<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> ^<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> /usr/include/mpich/mpicxx.h:87:17: note: in definition of macro ‘MPIX_CALLWORLD’<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> { int err = fnc ; if (err) MPIR_Call_world_errhand( err ); }<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> ^<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">There appear to be 17 compiler warnings of this type:<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:335, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const void*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:633, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const int (*)[3]’ to type ‘int (*)[3]’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:639, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const int (*)[3]’ to type ‘int (*)[3]’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1087, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const MPI_Request* {aka const int*}’ to type ‘MPI_Request* {aka int*}’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1412, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const void*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1690, GNU C Compiler 4 (gcc), Priority: Normal<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1691, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char**’ to type ‘char**’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1698, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1699, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char**’ to type ‘char**’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1712, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char**’ to type ‘char**’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1713, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char***’ to type ‘char***’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1713, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const int*’ to type ‘int*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1727, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char**’ to type ‘char**’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1728, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const char***’ to type ‘char***’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"> <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1728, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const int*’ to type ‘int*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1851, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const void*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.h:1872, GNU C Compiler 4 (gcc), Priority: Normal <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">cast from type ‘const void*’ to type ‘void*’ casts away qualifiers [-Wcast-qual]<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">A minimum working example of just translating the MPICH mpi.h header using <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx.mpich -o /tmp/test.o -c -fPIC -O3 -g -cxx=g++ -Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wunreachable-code -Wunused -Wno-unused-parameter -Wswitch-enum -Wredundant-decls -pedantic -Wswitch-default -fno-strict-aliasing -funroll-loops -mfpmath=sse -fopenmp -fno-omit-frame-pointer -msse3 -fPIC -std=c++11 /usr/include/mpich/mpi.h<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">produces the same compiler warnings on the following environment (mpich packages from the debian repository): <u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">debian@debian:~$ mpicxx.mpich -v<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">mpicxx for MPICH version 3.2<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">Using built-in specs.<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">COLLECT_GCC=g++<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">Target: x86_64-linux-gnu<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">Thread model: posix<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US">gcc version 6.3.0 20170516 (Debian 6.3.0-18)<u></u><u></u></span></p><p class="m_-7588226795307540661MsoPlainText"><span lang="EN-US"><u></u> <u></u></span></p><p class="m_-7588226795307540661MsoPlainText">Sincerely,<u></u><u></u></p><p class="m_-7588226795307540661MsoPlainText">Vincent<u></u><u></u></p><p class="m_-7588226795307540661MsoPlainText"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div>_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a></blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>