Skip to content

Conversation

@opoplawski
Copy link

No description provided.

@pr0m1th3as
Copy link
Member

octave_idx_type is the correct index type in this context. What it the purpose of your proposed changes?

@opoplawski
Copy link
Author

These are the types of warnings I'm seeing:

editDistance.cc:189:35: warning: comparison of integer expressions of different signedness: ‘octave_idx_type’ {aka ‘long int’} and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
editDistance.cc:203:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::vector<int> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]

You would think that octave_idx_type would be an appropriate index type, but it's signed instead of unsigned.

The more concerning warnings are these:

fcnn.cpp:127:17: warning: ‘i’ is used uninitialized [-Wuninitialized]
fcnn.cpp:213:15: warning: ‘i’ is used uninitialized [-Wuninitialized]

@pr0m1th3as
Copy link
Member

The more concerning warnings are these:

fcnn.cpp:127:17: warning: ‘i’ is used uninitialized [-Wuninitialized]
fcnn.cpp:213:15: warning: ‘i’ is used uninitialized [-Wuninitialized]

Thanks for catching this

@pr0m1th3as
Copy link
Member

I also made changes to editDistance to consistently use size_t instead of interchangeable using octave_idx_type and/or int with methods returning size_t. I assume that casting octave_idx_type (usually returned by methods of Octave classes, eg numel()) to size_t does not produce any warning.
Can you check whether any warning are emitted yet?

@pr0m1th3as pr0m1th3as closed this Feb 6, 2025
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

Successfully merging this pull request may close these issues.

2 participants