From: <no...@bu...> - 2004-06-24 14:13:04
|
The following bug has been REOPENED. ====================================================================== http://bugs.bacula.org/bug_view_advanced_page.php?bug_id=0000043 ====================================================================== Reported By: Dan Langille Assigned To: kern ====================================================================== Project: bacula Bug ID: 43 Category: bconsole Reproducibility: always Severity: tweak Priority: high Status: feedback ====================================================================== Date Submitted: 24-06-2004 05:09 PDT Last Modified: 24-06-2004 07:12 PDT ====================================================================== Summary: readline call with "const char *" causes compile error on FreeBSD Description: Compiling 1.34.5 encounters this error: ==>Entering directory /usr/home/dan/tmp/bacula/work/bacula-1.34.5/src/console c++ -c -I/usr/include/readline -I/usr/local/include -I. -I.. -O -pipe -D_THREAD_SAFE console.c console.c: In function `int get_cmd(FILE *, const char *, BSOCK *, int)': console.c:512: passing `const char *' as argument 1 of `readline(char *)' discards qualifiers *** Error code 1 ====================================================================== ---------------------------------------------------------------------- Dan Langille - 24-06-2004 05:11 PDT ---------------------------------------------------------------------- # gcc -v Using builtin specs. gcc version 2.95.4 20020320 [FreeBSD] ---------------------------------------------------------------------- Dan Langille - 24-06-2004 05:34 PDT ---------------------------------------------------------------------- from /usr/include/readline/readline.h, I see extern char *readline __P((char *)); So casting to (char *) is correct. Still looking. ---------------------------------------------------------------------- Dan Langille - 24-06-2004 05:40 PDT ---------------------------------------------------------------------- If the function is changed back, it compiles OK: < get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec) --- > get_cmd(FILE *input, char *prompt, BSOCK *sock, int sec) ---------------------------------------------------------------------- kern - 24-06-2004 06:55 PDT ---------------------------------------------------------------------- There are no negative consequences to adding the cast and it is a bit of a pity that the compiler will not do it automatically and simply flag it as a warning. The code as currently in Bacula is correct, and corresponds to what readline-4.3.5 expects in readline.h: extern char *readline PARAMS((const char *)); Perhaps you are running on an older version of readline? ---------------------------------------------------------------------- kern - 24-06-2004 07:01 PDT ---------------------------------------------------------------------- Fixed in 1.35.0 by adding cast for old versions of readline. ---------------------------------------------------------------------- Dan Langille - 24-06-2004 07:12 PDT ---------------------------------------------------------------------- FreeBSD -STABLE is using readline-4.1 Bug History Date Modified Username Field Change ====================================================================== 24-06-04 05:09 Dan Langille New Bug 24-06-04 05:11 Dan Langille Bugnote Added: 0000076 24-06-04 05:34 Dan Langille Bugnote Added: 0000077 24-06-04 05:40 Dan Langille Bugnote Added: 0000078 24-06-04 06:55 kern Bugnote Added: 0000080 24-06-04 06:55 kern Resolution open => not a bug 24-06-04 06:55 kern Status assigned => resolved 24-06-04 07:00 kern Resolution not a bug => reopened 24-06-04 07:00 kern Status resolved => feedback 24-06-04 07:01 kern Bugnote Added: 0000082 24-06-04 07:01 kern Resolution reopened => fixed 24-06-04 07:01 kern Status feedback => closed 24-06-04 07:12 Dan Langille Bugnote Added: 0000083 24-06-04 07:12 Dan Langille Resolution fixed => reopened 24-06-04 07:12 Dan Langille Status closed => feedback ====================================================================== |