[splint-discuss] real-compare

David Evans evans at cs.virginia.edu
Wed Nov 5 10:16:48 EST 2003


On Wed, 5 Nov 2003, Argenton Paolo wrote:

> 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:
>

Thanks, Paolo.  That looks good.  It is incorporated into the development
code now, with a new flag to get the warnings for relational comparisons
also.

--- Dave

> 	  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
> _______________________________________________
> splint-discuss mailing list
> splint-discuss at cs.virginia.edu
> http://www.splint.org/mailman/listinfo/splint-discuss
>



More information about the splint-discuss mailing list