warning

Issue #34 resolved
dsmic created an issue

/home/detlef/oakfoam-hg/oakfoam/src/engine/DecisionTree.cc:1788:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Comments (6)

  1. Francois van Niekerk repo owner

    Do you get a similar warning on other lines? It should at least get triggered by line 1791 as well. I'm using gcc 4.6.3 and I don't get that warning.

    The warning should affect functionality at all, but it should be resolved for obvious reasons.

  2. dsmic reporter

    No warning at 1791, even if I change 1788 from unsigned int i to signed int i. I use gcc 4.7.2 (debian testing)

  3. Francois van Niekerk repo owner

    Can you please try replace line 1788 with

    for (unsigned int i=1; i<(unsigned int)(1<<colslist.size()); i++)
    

    and see if that removes the warning for you?

  4. dsmic reporter

    for (unsigned int i=1; i<((unsigned int)1<<colslist.size()); i++)

    removed it, what I think might be the cleaner way. Now the unsigned int 1 is shifted?!

  5. Log in to comment