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 on conversion type from 'gmds::TCellID' to signed type 'int' #220

Closed
claireroche opened this issue Jan 27, 2023 · 2 comments
Closed
Assignees
Labels
Low Low priority on solving this issue quality code

Comments

@claireroche
Copy link
Collaborator

claireroche commented Jan 27, 2023

I have a warning in CLion when using a variable assignment. This warning is:
"Clang-Tidy: Narrowing conversion from 'gmds::TCellID' (aka 'unsigned int') to signed type 'int' is implementation-defined"

For instance, with the code:
Variable<double> *m_distance;
double b = m_distance->value(n.id());
Where n is a Node. n.id() is a gmds::TCellID (aka "unsigned int'), but in the class Variable.h, for the method value, here is the method signature:
T& value(const int &i) { return m_data[i]; }

(You can find an example on the file AdvectedPointRK4_3D.cpp, at line 254, 255, ...)

Shouldn't the "const int &i" be a "const TCellID &i" ?

@claireroche claireroche self-assigned this Jan 27, 2023
@create-issue-branch
Copy link

@franck-ledoux franck-ledoux self-assigned this Feb 1, 2023
@franck-ledoux franck-ledoux added quality code Low Low priority on solving this issue labels Feb 1, 2023
@franck-ledoux
Copy link
Member

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low Low priority on solving this issue quality code
Projects
None yet
Development

No branches or pull requests

2 participants