Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Resolution on unsigned >= 0 checks #370

Closed
breznak opened this issue Oct 31, 2013 · 10 comments · Fixed by #1680
Closed

Resolution on unsigned >= 0 checks #370

breznak opened this issue Oct 31, 2013 · 10 comments · Fixed by #1680

Comments

@breznak
Copy link
Member

breznak commented Oct 31, 2013

enabled in -Wextra, for GCC:
comparison of unsigned expression >= 0 is always true [-Wtype-limits]

or on Clang: tautological compare warning.

We have NTA_CHECK( 0 <= var && var <= MAX) << "var is out of range! " serving as a gate. However the var is set to dattype unsigned int hence the warning. My question is: remove the var >= 0 condition and assume (IFF) someone decides to change var's type to signed to take care of the checking? Or we want to keep this, and place surpress #pragma to each relevant occurence? Or we just keep ignoring and mute Wtype-limits?

@breznak
Copy link
Member Author

breznak commented Nov 5, 2013

@scottpurdy do I take your comment (on some PR) as remove these mytype var >= 0 checks globally? If so, we can remove the Wno-type-limits flag and start fixing these. It'd be trivial but long..

@ghost ghost assigned breznak Nov 8, 2013
@rhyolight
Copy link
Member

@breznak Still a valid ticket?

@breznak
Copy link
Member Author

breznak commented Aug 20, 2014

yes, still waiting for advice from others before taking up the simple but
long work.

@rhyolight
Copy link
Member

@scottpurdy Do you have any input?

@scottpurdy
Copy link
Contributor

I support this.

@breznak
Copy link
Member Author

breznak commented Dec 31, 2014

logic moved to nupic.core

@rhyolight
Copy link
Member

logic moved to nupic.core

@breznak what do you mean?

@breznak
Copy link
Member Author

breznak commented Dec 31, 2014

@rhyolight the c++ code is now in nupic.core repo, this issue is from '13. So I will just enable Wextra and call this closed.

@rhyolight
Copy link
Member

So I will just enable Wextra and call this closed.

Is there a PR for this?

@breznak
Copy link
Member Author

breznak commented Jan 8, 2015

@rhyolight closing as the checks have been fixed somewhen inbetween. and Wextra added in numenta/nupic.core-legacy#273

@breznak breznak closed this as completed Jan 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants