[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Recent clang warns on rl_message()
From: |
Chet Ramey |
Subject: |
Re: Recent clang warns on rl_message() |
Date: |
Sun, 4 Jun 2023 12:36:30 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 |
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 chet@case.edu http://tiswww.cwru.edu/~chet/