cppfront
cppfront copied to clipboard
g++12.2: cleanup compiler warnings
Here is a couple of small cleanups to reduce the noise from: g++ -W -Wall cppfront.cpp -std=c++20 -o cppfront
To aid seeing the wood for the trees, the actual invocation was: g++ -W -Wall -Wno-unused-parameter -Wno-unused-variable ....
Selectively drop those "-Wno-" options to get lots of noise.
That leaves 5 warnings for your consideration:
-
parse.h:1416:38: warning: missing initializer for member ‘cpp2::capture::str’ [-Wmissing-field-initializers] 1416 | n->cap_grp->push_back({n.get()});
parse.h:1419:62: warning: missing initializer for member ‘cpp2::postfix_expression_node::term::id_expr’ [-Wmissing-field-initializers] 1419 | auto term = postfix_expression_node::term{&curr()};
parse.h:1419:62: warning: missing initializer for member ‘cpp2::postfix_expression_node::term::op_close’ [-Wmissing-field-initializers]
parse.h: In member function ‘std::unique_ptrcpp2::declaration_node cpp2::parser::unnamed_declaration(cpp2::source_position, bool, bool)’:
parse.h:2803:14: warning: variable ‘start_pos’ set but not used [-Wunused-but-set-variable] 2803 | auto start_pos = pos;
This was run on Ubuntu 22.10 .