UPC++ public headers not -pedantic clean : UPCXX_ASSERT

Issue #106 resolved
Dan Bonachea created an issue

The UPC++ public headers currently generate a number of warnings when trying to build any UPC++ program using the g++ -pedantic switch. This makes it difficult for end users to use that switch for finding bugs in their own programs.

The warnings seem to currently be due to a non-compliant UPCXX_ASSERT macro.

On dirac using g++ 7.2.0:

$ gmake -C example/prog-guide hello-world EXTRA_FLAGS="-std=c++11 -pedantic"

/usr/local/pkg/gcc/7.2.0/bin/g++ hello-world.cpp -DUPCXX_BACKEND=1 -DUPCXX_BACKEND_gasnet1_seq=1 -DUPCXX_LPC_INBOX_locked=1 -D_GNU_SOURCE=1 -DGASNET_SEQ -D_REENTRANT -I/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/gasnet.debug/include -I/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/gasnet.debug/include/ibv-conduit -I/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include -g3 -Wno-unused -Wno-unused-parameter -Wno-address -std=c++11 -pedantic -L/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/lib -lupcxx -pthread -L/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/gasnet.debug/lib -lgasnet-ibv-seq -libverbs -L/usr/local/pkg/mellanox/hpcx-v1.8.0-gcc-OFED-3.5-redhat7.3-x86_64/fca/lib -lfca -lpthread -lrt -L/usr/local/pkg/gcc/7.2.0/lib/gcc/x86_64-pc-linux-gnu/7.2.0 -lgcc -lm -o hello-world
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/core.hpp:5:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future.hpp:4,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend.hpp:9,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:8,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/utility.hpp:25:25: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT(false);
                         ^
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future.hpp:4:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend.hpp:9,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:8,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/core.hpp:409:57: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
         UPCXX_ASSERT(this->status_ == status_results_yes);
                                                         ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/core.hpp:415:56: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
         UPCXX_ASSERT(this->status_ == status_results_no);
                                                        ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/core.hpp:422:56: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
         UPCXX_ASSERT(this->status_ == status_results_no);
                                                        ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/core.hpp:474:55: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
         UPCXX_ASSERT(this->status_ == status_not_ready);
                                                       ^
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future.hpp:9:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend.hpp:9,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:8,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/promise.hpp:55:44: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT(this->countdown_ + n > 0);
                                            ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/promise.hpp:60:45: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT(this->countdown_ - n >= 0);
                                             ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/future/promise.hpp:68:43: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT(this->countdown_-1 >= 0);
                                           ^
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend.hpp:10:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:8,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/persona.hpp:233:56: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
         UPCXX_ASSERT(persona_ == detail::tl_top_persona);
                                                        ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/persona.hpp:331:38: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     UPCXX_ASSERT(p.burstable_[q_user]); // If this failed then an internal action is trying to burst internal progress.
                                      ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/persona.hpp:340:40: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT(p.burstable_[q_user]);
                                        ^
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/command.hpp:6:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:5,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend.hpp:123,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:8,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/packing.hpp:206:88: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT(0 == (reinterpret_cast<std::uintptr_t>(buf_) & (lay_.alignment()-1)));
                                                                                        ^
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend.hpp:123:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:8,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:74:76: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     UPCXX_ASSERT(!UPCXX_GASNET1_SEQ || backend::master.active_with_caller());
                                                                            ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:79:76: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     UPCXX_ASSERT(!UPCXX_GASNET1_SEQ || backend::master.active_with_caller());
                                                                            ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:99:76: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     UPCXX_ASSERT(!UPCXX_GASNET1_SEQ || backend::master.active_with_caller());
                                                                            ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:109:34: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT_ALWAYS(ok == 0);
                                  ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:131:76: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     UPCXX_ASSERT(!UPCXX_GASNET1_SEQ || backend::master.active_with_caller());
                                                                            ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:141:34: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT_ALWAYS(ok == 0);
                                  ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:248:76: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     UPCXX_ASSERT(!UPCXX_GASNET1_SEQ || backend::master.active_with_caller());
                                                                            ^
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/backend/gasnet/runtime.hpp:258:34: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
       UPCXX_ASSERT_ALWAYS(ok == 0);
                                  ^
In file included from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/allocate.hpp:10:0,
                 from /usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/upcxx.hpp:8,
                 from hello-world.cpp:1:
/usr/local/pkg/upcxx-dirac/gcc-7.2.0/nightly-2017.11.25/upcxx.debug.gasnet1_seq.ibv/include/upcxx/global_ptr.hpp:62:69: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
         UPCXX_ASSERT(raw_ptr_ && "address must be in shared segment");
                                                                     ^

Comments (1)

  1. Log in to comment