Skip to content
New issue

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

Warning about unused parameter 'node' in 'get_argument_vector' function #183

Closed
mtiapko opened this issue Jan 7, 2021 · 1 comment
Closed

Comments

@mtiapko
Copy link

mtiapko commented Jan 7, 2021

Hi!

I'm getting warnings about unused parameter 'node' in this function:

Arguments get_argument_vector(size_t N, const AstNode& node) {

Function get_arguments uses node parameter to throw exception. So I don't know if it is right to remove node parameter from get_argument_vector function, or it is better to add a similar check as in get_arguments function:

std::array<const json*, N> get_arguments(const AstNode& node) {
if (json_eval_stack.size() < N) {
throw_renderer_error("function needs " + std::to_string(N) + " variables, but has only found " + std::to_string(json_eval_stack.size()), node);
}

Compiling using g++ 10.2.0 with -Wall -Wextra flags.

@pantor
Copy link
Owner

pantor commented Jan 16, 2021

You're right, there should be a check 👍 I've added one with the latest commit to the master branch, so this issue should be fixed.

@pantor pantor closed this as completed Jan 16, 2021
mtiapko added a commit to mtiapko/transformer that referenced this issue Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants