chenan2005 / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Visual C++ 2005 complains about while (1) in densehashtable.h on line 658 (Warning level 4) #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce, compile with Visual C++ 2005, warning level set to 4

Expected compilation without warnings. Instead I get warning C4127,
conditional expression is constant. 

I'm using the 0.8.1 package. A fix that does work is replacing the while
(1) loop with a for (;;) loop.

Original issue reported on code.google.com by mark.sar...@gmail.com on 27 Aug 2007 at 10:29

GoogleCodeExporter commented 9 years ago
Is warning level 4 high or low?  That is, is it a particularly pedantic warning
level?  "while (1)" is idiomatic in this codebase, and seems perfectly 
reasonable to
me; I don't see a particular reason to change it to "for (;;)".  We also might 
use
do/while(0) in macros, which would be harder to avoid that warning.

I'll just supress warning C4127 in the windows compile.

Original comment by csilv...@gmail.com on 9 Oct 2007 at 9:00

GoogleCodeExporter commented 9 years ago
Sparsehash 0.9 was just released, which should fix this problem.

Original comment by csilv...@gmail.com on 9 Oct 2007 at 10:39