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


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:


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);


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

Change History (3)

comment:1 by anevilyak, 9 years ago

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

comment:2 by axeld, 9 years ago

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

comment:3 by axeld, 9 years ago

Resolution: fixed
Status: in-progressclosed

Added missing prototypes in hrev38880.

Note: See TracTickets for help on using tickets.