Change naming convention for enum class enumerators
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 28 Mar 2024 18:55:27 +0000 (14:55 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
commit1c5ea5eb3a9adbc3adc4a3a36a6cf09f7fa05bf1
treedf14438e696be929c8afcf38adda7ab9bfc0c9b5
parenteee15e593cc1c99b61d5d7089aea2f47e820b461
Change naming convention for enum class enumerators

Change the naming convention for enum class enumerators to not use
`ALL_CAPS`, as suggested by the C++ Core Guidelines [1].  Instead, use
camel case starting with a capital letter.

Update `CONTRIBUTING.adoc` to reflect this change.

gcc emits warnings like this:

    /home/smarchi/src/babeltrace/src/cpp-common/bt2/trace-ir.hpp:880:9: error: declaration of 'bt2::CommonEventClass<LibObjT>::LogLevel::Error' shadows a global declaration [-Werror=shadow]
      880 |         Error = BT_EVENT_CLASS_LOG_LEVEL_ERROR,
          |         ^~~~~
    In file included from /home/smarchi/src/babeltrace/src/cpp-common/bt2/clock-class.hpp:20,
                     from /home/smarchi/src/babeltrace/src/clock-correlation-validator/clock-correlation-validator.cpp:7:
    /home/smarchi/src/babeltrace/src/cpp-common/bt2/exc.hpp:14:7: note: shadowed declaration is here
       14 | using Error = bt2c::Error;
          |       ^~~~~

Whether or not this is a compiler bug is not clear [2], but in our case
we know it's fine.  Add and use `BT_DIAG_IGNORE_SHADOW` in some places
to silence these warnings.

[1] https://cpp-core-guidelines-docs.vercel.app/enum#Renum-caps
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55776

Change-Id: I59bb7f3c8572106c325596bc80a4d70714d86dee
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12212
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
23 files changed:
CONTRIBUTING.adoc
src/clock-correlation-validator/clock-correlation-validator.cpp
src/clock-correlation-validator/clock-correlation-validator.hpp
src/common/macros.h
src/cpp-common/bt2/component-class-dev.hpp
src/cpp-common/bt2/component-class.hpp
src/cpp-common/bt2/error.hpp
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/field-path.hpp
src/cpp-common/bt2/graph.hpp
src/cpp-common/bt2/logging.hpp
src/cpp-common/bt2/message.hpp
src/cpp-common/bt2/trace-ir.hpp
src/cpp-common/bt2/value.hpp
src/cpp-common/bt2c/logging.hpp
src/plugins/utils/muxer/msg-iter.cpp
src/plugins/utils/muxer/upstream-msg-iter.cpp
src/plugins/utils/muxer/upstream-msg-iter.hpp
tests/lib/conds/clk-cls-compat-postconds-triggers.cpp
tests/lib/conds/conds-triggers.cpp
tests/lib/conds/utils.cpp
tests/lib/conds/utils.hpp
tests/plugins/flt.utils.muxer/test-clock-compatibility.cpp
This page took 0.026231 seconds and 4 git commands to generate.