We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A small request from me. It'd be nice if args.hxx didn't generate warnings about unused parameters.
Ideally, it'd also avoid -Wshadow warnings, but this option is probably not that popular.
-Wshadow
$ g++-6 -Wall -Wextra test.cxx -I. In file included from test.cxx:16:0: ./args.hxx: In member function ‘virtual std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > args::Base::GetDescription(const string&, const string&, const string&, const string&) const’: ./args.hxx:400:92: warning: unused parameter ‘shortPrefix’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~~ ./args.hxx:400:124: warning: unused parameter ‘longPrefix’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~ ./args.hxx:400:155: warning: unused parameter ‘shortSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~~~~~ ./args.hxx:400:190: warning: unused parameter ‘longSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~~~~ ./args.hxx: In member function ‘virtual std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > args::NamedBase::GetDescription(const string&, const string&, const string&, const string&) const’: ./args.hxx:436:92: warning: unused parameter ‘shortPrefix’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~ ./args.hxx:436:124: warning: unused parameter ‘longPrefi’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~ ./args.hxx:436:154: warning: unused parameter ‘shortSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~~ ./args.hxx:436:189: warning: unused parameter ‘longSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~ ./args.hxx: In member function ‘virtual std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > args::FlagBase::GetDescription(const string&, const string&, const string&, const string&) const’: ./args.hxx:516:155: warning: unused parameter ‘shortSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~~ ./args.hxx:516:190: warning: unused parameter ‘longSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~ ./args.hxx: In static member function ‘static bool args::Group::Validators::DontCare(const args::Group&)’: ./args.hxx:636:51: warning: unused parameter ‘group’ [-Wunused-parameter] static bool DontCare(const Group &group) ^~~~~ ./args.hxx: In static member function ‘static bool args::Group::Validators::CareTooMuch(const args::Group&)’: ./args.hxx:641:54: warning: unused parameter ‘group’ [-Wunused-parameter] static bool CareTooMuch(const Group &group) ^~~~~ In file included from test.cxx:16:0: ./args.hxx: In member function ‘bool args::ValueReader<std::__cxx11::basic_string<char> >::operator()(const string&, const string&, std::__cxx11::string&)’: ./args.hxx:1567:44: warning: unused parameter ‘name’ [-Wunused-parameter] bool operator()(const std::string &name, const std::string &value, std::string &destination) ^~~~ test.cxx: In member function ‘void DoublesReader::operator()(const string&, const string&, std::tuple<double, double>&)’: test.cxx:297:40: warning: unused parameter ‘name’ [-Wunused-parameter] void operator()(const std::string &name, const std::string &value, std::tuple<double, double> &destination) ^~~~ test.cxx: In member function ‘void ToLowerReader::operator()(const string&, const string&, std::__cxx11::string&)’: test.cxx:424:40: warning: unused parameter ‘name’ [-Wunused-parameter] void operator()(const std::string &name, const std::string &value, std::string &destination) ^~~~ In file included from test.cxx:576:0: ./args.hxx: In member function ‘virtual std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > argstest::Base::GetDescription(const string&, const string&, const string&, const string&) const’: ./args.hxx:400:92: warning: unused parameter ‘shortPrefix’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~~ ./args.hxx:400:124: warning: unused parameter ‘longPrefix’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~ ./args.hxx:400:155: warning: unused parameter ‘shortSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~~~~~ ./args.hxx:400:190: warning: unused parameter ‘longSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const ^~~~~~~~~~~~~ ./args.hxx: In member function ‘virtual std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > argstest::NamedBase::GetDescription(const string&, const string&, const string&, const string&) const’: ./args.hxx:436:92: warning: unused parameter ‘shortPrefix’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~ ./args.hxx:436:124: warning: unused parameter ‘longPrefi’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~ ./args.hxx:436:154: warning: unused parameter ‘shortSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~~ ./args.hxx:436:189: warning: unused parameter ‘longSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefi, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~ ./args.hxx: In member function ‘virtual std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > argstest::FlagBase::GetDescription(const string&, const string&, const string&, const string&) const’: ./args.hxx:516:155: warning: unused parameter ‘shortSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~~ ./args.hxx:516:190: warning: unused parameter ‘longSeparator’ [-Wunused-parameter] virtual std::tuple<std::string, std::string> GetDescription(const std::string &shortPrefix, const std::string &longPrefix, const std::string &shortSeparator, const std::string &longSeparator) const override ^~~~~~~~~~~~~ ./args.hxx: In static member function ‘static bool argstest::Group::Validators::DontCare(const argstest::Group&)’: ./args.hxx:636:51: warning: unused parameter ‘group’ [-Wunused-parameter] static bool DontCare(const Group &group) ^~~~~ ./args.hxx: In static member function ‘static bool argstest::Group::Validators::CareTooMuch(const argstest::Group&)’: ./args.hxx:641:54: warning: unused parameter ‘group’ [-Wunused-parameter] static bool CareTooMuch(const Group &group) ^~~~~ In file included from test.cxx:576:0: ./args.hxx: In member function ‘bool argstest::ValueReader<std::__cxx11::basic_string<char> >::operator()(const string&, const string&, std::__cxx11::string&)’: ./args.hxx:1567:44: warning: unused parameter ‘name’ [-Wunused-parameter] bool operator()(const std::string &name, const std::string &value, std::string &destination) ^~~~ ./args.hxx: In instantiation of ‘bool argstest::ValueReader<T>::operator()(const string&, const string&, T&) [with T = int; std::__cxx11::string = std::__cxx11::basic_string<char>]’: ./args.hxx:1600:21: required from ‘void argstest::ValueFlag<T, Reader>::ParseValue(const string&) [with T = int; Reader = argstest::ValueReader<int>; std::__cxx11::string = std::__cxx11::basic_string<char>]’ test.cxx:635:1: required from here ./args.hxx:1540:45: warning: unused parameter ‘name’ [-Wunused-parameter] bool operator ()(const std::string &name, const std::string &value, T &destination)
The text was updated successfully, but these errors were encountered:
+1 from me.
Sorry, something went wrong.
No longer an issue? "g++-6 -Wall -Wextra test.cxx -I." did not produce the warnings that occurred for @wojdyr in 2017.
Looks like this was addressed by Pavel Belikov on 2017-11-06. Not sure if that was specifically in response to this issue or not.
No branches or pull requests
A small request from me.
It'd be nice if args.hxx didn't generate warnings about unused parameters.
Ideally, it'd also avoid
-Wshadow
warnings, but this option is probably not that popular.The text was updated successfully, but these errors were encountered: