On 6/4/23 9:52 AM, 林宏雄 wrote:
clang-14 (and later) warns on rl_message().
$ cat rl_message_warn.c
#include <stdio.h>
#include "readline/readline.h"
void test() {
rl_message("hello");
}
$ cc -c -I$HOME/opt/include rl_message_warn.c
rl_message_warn.c:4:15: warning: passing arguments to 'rl_message' without
a prototype is deprecated in all versions of C and is not supported in C2x
[-Wdeprecated-non-prototype]
rl_message("hello");
The first answer to this is that I changed bash and readline to be (mostly)
C23 conformant starting in December, 2022, so this isn't going to be a
problem moving forward.
Part of the rationale for finally doing that was to avoid problems like this.
For now, you can sidestep the issue by arranging for HAVE_STDARG_H to be
defined before including readline.h, perhaps on the cc/gcc command line.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/