Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Roland Dreier (rdreier_at_[hidden])
Date: 2007-04-18 11:56:40

> I.e., it returns a long. Although some compilers might do the right
> thing, conversions should be explicitly shown.

Isn't the behavior guaranteed by the C standard? And I can't even
imagine a way for a compiler to get

        intvar = strtol(foo);

wrong, and it seems even more implausible that such a bug would be
cured just by adding a cast to int.

Maybe you could get the same effect by leaving the cast out and
wearing a magnetized titanium bracelet while writing the code?

 - R.