You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is relatively minor, but I thought I'd mention it before I forget about them: building function2 strictly as a copied header with clang can trigger a few warnings, if you enable them.
Commit Hash
5b8e6de
Expected Behavior
Builds cleanly (no warnings).
Actual Behavior
Building generates warnings, as follows:
An uninitialized-member warning due to member variables cmd_ and vtable_ not having default initializers and not being explicitly initialized in the default constructor for class type_erasure::tables::vtable.
member 'cmd_' is missing from constructor initializer list [-Werror,-Wuninitialized-member]
member 'vtable_' is missing from constructor initializer list [-Werror,-Wuninitialized-member]
Easily fixed by changing the member declarations this:
The use of the variable name allocator in various places triggers a shadow warning, due to the base class in libstdc++ also using it. (note: this is a gcc warning and was built with gcc, not clang)
declaration of 'allocator' shadows a member of ... [-Werror=shadow]
include/c++/7/bits/allocator.h:109:5: note: shadowed declaration is here
The enum class opcode enumerations use doxygen-like comments that don't follow doxygen correctly, triggering a documentation warning.
not a Doxygen trailing comment [-Werror,-Wdocumentation]
op_move, //< Move the object and set the vtable
^~~
///<
Changing them to this fixes it:
enum class opcode
{
op_move, ///< Move the object and set the vtable
op_copy, ///< Copy the object and set the vtable
op_destroy, ///< Destroy the object and reset the vtable
op_weak_destroy, ///< Destroy the object without resetting the vtable
op_fetch_empty, ///< Stores true or false into the to storage
///< to indicate emptiness
};
Steps to Reproduce
Build using clang with -Weverything or the specific warnings described earlier, except for (2) which was found using gcc.
This was built simply as a copied header - i.e., not using the CMake settings in this project. (built for C++17)
Your Environment
OS: Linux
Compiler and version: clang version 5.0.0
Standard library (if non default): gcc's libstdc++ (from gcc version 7.3.1)
The text was updated successfully, but these errors were encountered:
Thanks for your report. The uninitialized-member warning is triggered because some members are initialized in the content of the constructor, mayne this can be improved.
The other warnings will be fixed soon.
@Naios
This is relatively minor, but I thought I'd mention it before I forget about them: building
function2
strictly as a copied header withclang
can trigger a few warnings, if you enable them.Commit Hash
5b8e6de
Expected Behavior
Builds cleanly (no warnings).
Actual Behavior
Building generates warnings, as follows:
uninitialized-member
warning due to member variablescmd_
andvtable_
not having default initializers and not being explicitly initialized in the default constructor for classtype_erasure::tables::vtable
.Easily fixed by changing the member declarations this:
allocator
in various places triggers a shadow warning, due to the base class in libstdc++ also using it. (note: this is agcc
warning and was built withgcc
, notclang
)opcode
enumerations use doxygen-like comments that don't follow doxygen correctly, triggering adocumentation
warning.Changing them to this fixes it:
Steps to Reproduce
Build using
clang
with-Weverything
or the specific warnings described earlier, except for (2) which was found usinggcc
.This was built simply as a copied header - i.e., not using the
CMake
settings in this project. (built for C++17)Your Environment
clang version 5.0.0
libstdc++
(from gcc version 7.3.1)The text was updated successfully, but these errors were encountered: