xarray / osgRecipes

OpenSceneGraph (OSG) Recipes
348 stars 167 forks source link

The expression RAND_MAX+1 overflows on Linux as RAND_MAX is defined as 2... #2

Closed aluaces closed 12 years ago

aluaces commented 12 years ago

...147483647.

Hi, when compiling, GCC emits several messages of the type "warning: integer overflow in expression [-Woverflow]". This happens because at least on this environment RAND_MAX+1 is overflowing. Since the source code is just for demonstration, removing the "+1" seems to be fine.