[splint-discuss] real-compare

Argenton Paolo Paolo.Argenton at elsag.it
Wed Nov 5 07:56:57 EST 2003


I made the following modification to splint 3.1.1 in order to have a warning
only for the following double / float comparisons
     x == y
     x != y
and to ignore the others:

      x <  y
      x <= y
      x >= y
      x >  y

source modified is exprNode.c line number is about 5823 the patch is the
following:

	  if (fepsilon)
	    {
	      ; /* Don't complain. */
	    }
	  else
/* my mod: following test was not present in the original */
        if (opid == EQ_OP || opid == NE_OP)
	    {

	      voptgenerror
		(FLG_REALCOMPARE,
		 message ("Dangerous comparison involving %s types: %s",
			  ctype_unparse (rtype),
			  exprNode_unparse (ret)),
		 ret->loc);
	    }
	}
  

Please let me know if you agress since is the first time I try such a
thing...
Regards
Paolo Argenton



More information about the splint-discuss mailing list