Re[2]: [patches] [PATCH] Fix FreeBSD build

Konstantin Belyavskiy k.belyavskiy at tarantool.org
Wed Mar 7 13:57:31 MSK 2018


As I checked _POSIX_C_SOURCE yesterday, it doesn't work on OSX.
Also we are already using _GNU_SOURCE flag in  src/box/lua/info.c and i n various third-party modules.

I can use cmake, but again I think there are two options:
1. Using getline with _GNU_SOURCE flag as in man example.
2. Get rid of getline

>Среда,  7 марта 2018, 13:16 +03:00 от Konstantin Osipov <kostja at tarantool.org>:
>
>* Konstantin Belyavskiy < k.belyavskiy at tarantool.org > [18/03/07 12:06]:
>> >* Konstantin Osipov <  kostja at tarantool.org > [18/03/06 21:38]:
>> >> Please avoid doing this in say.c, add compile definitions in
>> >> cmake, or use sscanf instead of getline(). 
>> >
>> >snscanf()
>> There is no standard function snscanf
>> And why should I not using macro?
>
>The policy for compile-time defines is that they should be either
>in trivia/config.h, if they are project-global, or in cmake file
>flags if they are executable-local.
>
>The trouble with the approach which you employed is that, when
>used systematically, it can blow up on a new platform or with an
>upgrade. 
>
>The second thing is that we should not make our code GNU-toolchain
>dependent.
>
>Looks like getline is part of POSIX 2008, so it's better to use a
>standard define, such as _POSIX_C_SOURCE .
>
>If you can't use sscanf, why not use fgets()?
>
>-- 
>Konstantin Osipov, Moscow, Russia,  +7 903 626 22 32
>http://tarantool.org -  www.twitter.com/kostja_osipov


Best regards,
Konstantin Belyavskiy
k.belyavskiy at tarantool.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20180307/eb26051b/attachment.html>


More information about the Tarantool-patches mailing list