<HTML><BODY><br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        Среда,  7 марта 2018, 15:58 +03:00 от Konstantin Osipov <kostja@tarantool.org>:<br><br><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15204275080000000847_BODY">* Konstantin Belyavskiy <<a href="mailto:k.belyavskiy@tarantool.org">k.belyavskiy@tarantool.org</a>> [18/03/07 13:58]:<br>
                                 > As I checked _POSIX_C_SOURCE yesterday, it doesn't work on OSX.<br>
> Also we are already using _GNU_SOURCE flag in <br>
> src/box/lua/info.c and i n various third-party modules.<br><br>
BTW, this is a good proof why this approach is broken.<br><br>
If you look at the original patch, git show d00ebc91, you'll see<br>
that gnu source was added to compile a piece of code which is no<br>
longer there. The code is now gone, and the gnuism is stuck in the<br>
source forever. <br><br>
If you look at the patch itself, it was a yet another quick fix<br>
made in a rush and most likely pushed without thorough<br>
consideration.<br><br>
Please don't follow that path.<br><br>
We should either make a decision to use getline() and make a<br>
compatibility wrapper in third_party/compat, or get rid of it.<br><br>
> I can use cmake, but again I think there are two options:<br>
> 1. Using getline with _GNU_SOURCE flag as in man example.<br>
> 2. Get rid of getline<br><br>
Yes, please get rid of getline(). You can make a compatibility<br>
wrapper if you like, in third_party/compat, which is the same as<br>
getting rid of it. You can use fscanf(). You can dig up how to<br>
properly make POSIX standard api available on Mac OS X and add<br>
this define to trivia/config.h, so that we never again have an<br>
issue with POSIX functions on MAC OS X. There are so many sound<br>
alternatives, please just do one of them.</div></div></div></div></blockquote>I personally think that <em>fscanf</em> is a bad alternative to <em>getline</em> since last<br>allocates memory itself so getline is quite safe and we don't need to<br> reinvent the wheel. Maybe wrapper will be a better option.<br><br>Regarding to make POSIX api available on OSX I will try it during<br>long weekend.<br>As for now I can use _POSIX_C_SOURCE for BSD only or for OS<br>except OSX.<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15204275080000000847_BODY">
-- <br>
Konstantin Osipov, Moscow, Russia, <span class="js-phone-number">+7 903 626 22 32</span><br><a href="http://tarantool.org" target="_blank">http://tarantool.org</a> - <a href="http://www.twitter.com/kostja_osipov" target="_blank">www.twitter.com/kostja_osipov</a><br></div></div></div></div></blockquote>
<br>
<br>Best regards,<br>Konstantin Belyavskiy<br>k.belyavskiy@tarantool.org<br></BODY></HTML>