[patches] [PATCH] Fix FreeBSD build

Konstantin Osipov kostja at tarantool.org
Wed Mar 7 13:16:19 MSK 2018


* 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



More information about the Tarantool-patches mailing list