Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Andrew Lumsdaine (lums_at_[hidden])
Date: 2007-04-18 11:46:42


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
>> devel_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/devel
>
>
> --
> Jeff Squyres
> Cisco Systems
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel