cxx: remove compilation warnings in C++ code, from both gcc and clang
authorVitor Sousa <vitorsousa@expertisesolutions.com.br>
Fri, 12 Jul 2019 13:07:27 +0000 (09:07 -0400)
committerTaehyub Kim <taehyub.kim@samsung.com>
Wed, 17 Jul 2019 07:20:31 +0000 (16:20 +0900)
commitf598f5d1bc45bcda66381a92ac447d8fac472b33
tree9b2d61cd88dc5bd814aa3a79a41797d37a1c6c62
parent94431d3a78d55492ea0a4c098ddbfd533797e79a
cxx: remove compilation warnings in C++ code, from both gcc and clang

Summary:
Remove almost all the compilation warnings from C++ code. Only explicit
warnings using the `#warning` preprocessor directive remain.

Some warnings had to be suppressed with `#pragma` directives because the
behavior they were warning about is intended in some specific places.
Code comments were added in such situations.

Added a generator that creates `#pragma` directives in order to suppress
warnings in all generated C++ headers.
Currently `-Wignored-qualifiers` is the only warning category being suppressed.
The innocuous const qualifiers that it points are inoffensive and have
no effect in compilation at all.
They are also hard to track in generation since they can emerge from different
types in many places.

To ease the generation of the warning suppressors an utility constructor was
added to `efl::eolian::grammar::attributes::unused_type`.

Add constructors to `eolian_mono::class_context` to default initialize its
internal string and avoid field initialization warnings.

Test Plan: `meson test`

Reviewers: lauromoura, felipealmeida, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl_language_bindings

Differential Revision: https://phab.enlightenment.org/D9275
16 files changed:
src/bin/eolian_mono/eolian/mono/events.hh
src/bin/eolian_mono/eolian/mono/generation_contexts.hh
src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
src/bin/eolian_mono/eolian/mono/type_impl.hh
src/bindings/cxx/eina_cxx/eina_optional.hh
src/bindings/cxx/eldbus_cxx/eldbus_service.hh
src/lib/eolian_cxx/grammar/attributes.hpp
src/lib/eolian_cxx/grammar/class_implementation.hpp
src/lib/eolian_cxx/grammar/generator.hpp
src/lib/eolian_cxx/grammar/header.hpp
src/lib/eolian_cxx/grammar/ignore_warning.hpp [new file with mode: 0644]
src/lib/eolian_cxx/grammar/type_impl.hpp
src/lib/ephysics/ephysics_quaternion.cpp
src/tests/ecore_cxx/ecore_cxx_test_safe_call.cc
src/tests/eina_cxx/eina_cxx_test_optional.cc
src/tests/eina_cxx/eina_cxx_test_ptrlist.cc