On 04.01.2017 16:36, Juha Sointusalo wrote:
> On 4 January 2017 at 02:24, Artem Vorotnikov <[email protected]
> <mailto:[email protected]>> wrote:
>
>     For the record, strdup() is *not* standard, it is a GNU extension and
>     not part of ANSI/ISO C.
>
>
> It is in POSIX. MSVC knows it as _strdup() .

It would still work by doing something like this:

safe_copy(cstr){
#ifdef MSVC
return _strdup(cstr);
#else
return strdup(cstr);
#endif
}

which would encapsulate the platform specific implementation nicely. But
it would still allocate memory. But that was not my point in the beginning.

I accept all reasons given in this email thread about why this function
is problematic and maybe should be discussed. The reason I'm not willing
to accept is the one given in the commit message. Just because something
is producing warnings on one platform is not justification enough to
remove it. That was the point I wanted to bring across.

Regards
Christian

_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to