bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does stdio.h have to be included before readline/readline.h (ins


From: Peng Yu
Subject: Re: Why does stdio.h have to be included before readline/readline.h (installed via homebrew) on macOS?
Date: Wed, 19 May 2021 12:11:23 -0500

But on Linux, stdio.h is not needed. Can't the behavior be made the
same on Linux and macOS?

On 5/19/21, Chet Ramey <chet.ramey@case.edu> wrote:
> On 5/19/21 9:28 AM, Peng Yu wrote:
>> Hi,
>>
>> stdio.h must be included before readline/readline.h in the following
>> program in order for it to compile on macOS. But the program can be
>> compiled on Linux when stdio.h is deleted.
>
> If you want to use stdio functions like printf, you need to include
> stdio.h.
>
> Several readline functions return EOF (e.g., rl_getc), so if you want to
> use those in your program, you need to include stdio.h.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]