Opened 9 years ago

Closed 9 years ago

#6646 closed enhancement (fixed)

implicit declaration of function 'getline'

Reported by: diger Owned by: axeld
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/Development
Keywords: getline getdelim posix Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

VLC media player compilation reportedly fails due to getline() not being defined.

make[4]: Entering directory `/boot/home/src/vlc/src' 
 CC config/libvlccore_la-dirs_xdg.lo | config/dirs_xdg.c: In function 'config_GetTypeDir': config/dirs_xdg.c:141: |
error: implicit declaration of function 'getline'

Haiku have not getline().

getline() and getdelim() are specified by POSIX here: http://www.opengroup.org/onlinepubs/9699919799/functions/getline.html

How-To-Repeat:

C-compile the following test case:

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    char *line = NULL;
    size_t linesize = 0;
    ssize_t linelen;

    while ((linelen = getline(&line, &linesize, stdin)) !=-1)
    fwrite(line, 1, linelen, stdout);

    free(line);

    if (ferror(stdin))
    {
       perror("Standard input");
       return 1;
     }
      return 0;
}

Change History (3)

comment:1 Changed 9 years ago by anevilyak

Component: - GeneralSystem/POSIX
Keywords: getline getdelim posix added
Type: bugenhancement
Version: R1/alpha2R1/Development

comment:2 Changed 9 years ago by axeld

Owner: changed from nobody to axeld
Status: newin-progress

comment:3 Changed 9 years ago by axeld

Resolution: fixed
Status: in-progressclosed

Added missing prototypes in hrev38880.

Note: See TracTickets for help on using tickets.