Last Comment Bug 535861 - LInsHashKind iteration can trigger compiler warnings
: LInsHashKind iteration can trigger compiler warnings
[build_warning] fixed-in-nanojit, fix...
Product: Core Graveyard
Classification: Graveyard
Component: Nanojit (show other bugs)
: unspecified
: ARM Other
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
Blocks: buildwarning
  Show dependency treegraph
Reported: 2009-12-18 12:51 PST by Steven Johnson
Modified: 2014-03-17 08:00 PDT (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Patch (437 bytes, patch)
2009-12-18 12:54 PST, Steven Johnson
edwsmith: review+
Details | Diff | Splinter Review

Description User image Steven Johnson 2009-12-18 12:51:58 PST
The idiom

    for (LInsHashKind kind = LInsFirst; kind <= LInsLast; kind = nextKind(kind)) 

will trigger

    comparison is always true due to limited range of data type

warnings/errors dependings on compiler configuration.
Comment 1 User image Steven Johnson 2009-12-18 12:54:16 PST
Created attachment 418416 [details] [diff] [review]
Comment 2 User image Edwin Smith 2009-12-21 18:18:43 PST
Comment on attachment 418416 [details] [diff] [review]

"compilers that will insist..." is heresay and spreads fear, uncertianty, and doubt... the comment should say what compiler it is, so later we can re-check whether the hack is still needed.
Comment 3 User image Steven Johnson 2009-12-21 18:31:57 PST
I wrote "will trigger... warnings/errors depending on compiler configuration", "compilers will insist"... :-)

For the record, it was a variant of gcc 4.4 building for Android; I'm guessing (without proof) that any gcc 4.4 variant can be persuaded to complain in similar fashion if you configure its warning level in a similarly anal-retentive manner.
Comment 5 User image Steven Johnson 2009-12-22 17:01:23 PST
Comment 6 User image Ed Morley [:emorley] 2011-07-09 06:03:01 PDT
(Fixed 18 months ago)

Note You need to log in before you can comment on or make changes to this bug.