And the man page (on OS X) has this prototype for strol():


     long
strtol(const char * restrict nptr, char ** restrict endptr, int base);


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


On Apr 18, 2007, at 11:38 AM, Jeff Squyres wrote:

Because the target variable is an (int).  Plus, the man pages on OSX
and Linux both say that atoi() is the exact equivalent of

     (int)strtol(nptr, (char **)NULL, 10);

and that atoi() is deprecated (which I didn't know).


On Apr 18, 2007, at 11:32 AM, Roland Dreier wrote:

With the (int) cast, I'm ok with it now.  :-)

What's the point of the cast to int?

 - R.
_______________________________________________
devel mailing list
de...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/devel


--
Jeff Squyres
Cisco Systems

_______________________________________________
devel mailing list
de...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/devel

Reply via email to