[tlbuild] interact.cc and getline insanity

John Bowman bowman at ualberta.ca
Thu Apr 24 15:35:18 CEST 2014


On Thu, Apr 24, 2014 at 2:05 AM, Mojca Miklavec <
mojca.miklavec.lists at gmail.com> wrote:

>
> The getline function is not portable.  It is GNU/Linux specific.  It
> is documented as such on the manpage and in the libc


That is incorrect. From the Linux man page:

"CONFORMING TO
       Both getline() and getdelim() were  originally  GNU  extensions.
They
       were standardized in POSIX.1-2008."

It is now 2014: only very old (and neglected) platforms should be affected.
May I suggest that one either upgrade such systems or simply ignore them.

You may need to define some macro to enable _POSIX_C_SOURCE
(for details, check the stdio.h header).
Let me know what is needed for Solaris 11 and I will add it to interact.cc.

For example, getline was added to FreeBSD libc with FreeBSD 8.0.
Therefore, on __FreeBSD_version >= 800067 I understand that the
following works:

#define _WITH_GETLINE
#include <stdio.h>

 -- John

P.S. As a very last resort, the attached reversion provides an inelegant
patch.
But please first check your headers to see how to make your system POSIX
2008 compliant
(and complain to your vendor; as this really shouldn't be necessary).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tlbuild/attachments/20140424/3eda8a82/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getline.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://tug.org/pipermail/tlbuild/attachments/20140424/3eda8a82/attachment-0001.bin>


More information about the tlbuild mailing list