compile time warnings (pointer to int casts) on 64bit architectures

Henrique de Moraes Holschuh hmh at debian.org
Thu Jun 8 16:28:42 EDT 2006


On Thu, 08 Jun 2006, Sven Mueller wrote:
> pararmeter is non-NULL. An alternative would have been to replace
>     int ignore_err = (int) rock;
> with
>     int ignore_err = (int) (rock!=NULL);
> which should be logically equivalent to the patch I made.

If you are going to do that, IMHO it is much better to get rid of the
typecast which is just a crutch anyway:

int ignore_err = (rock!=NULL) ? 1 : 0;

gcc 4.x will optimize it properly, I bet.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


More information about the Cyrus-devel mailing list