On Tue, Jun 17, 2003 at 01:31:11PM -0600, D. Stimits wrote:
>Now I am not arguing that /usr/include/ncurses/curses.h makes the const
>in the header, because the header DOES make these const. However, the
>actual implementation is not using const, which causes the pickier
>compilers to mark it as an error and fail to build. The
>header does not match what is in the actual library. I can guarantee
>that I am linking against the 5.3-4 rpm version, and I believe the g++
>compiler is telling the truth when it claims the symbols in the library
>for fmt are not const. My question right now is "how did the compile
>lose the const, when the header contains const"?
I don't know (didn't inspect the rpm file). The corresponding file
that you
appear to be referring to doesn't have any casts in it. Here's a piece:
MODULE_ID("$Id: lib_printw.c,v 1.15 2003/02/08 20:50:13 tom Exp $")
NCURSES_EXPORT(int)
printw(const char *fmt,...)
{
va_list argp;
int code;
#ifdef TRACE
va_start(argp, fmt);
T((T_CALLED("printw(%s%s)"),
_nc_visbuf(fmt), _nc_varargs(fmt, argp)));
va_end(argp);
#endif
va_start(argp, fmt);
code = vwprintw(stdscr, fmt, argp);
va_end(argp);
returnCode(code);
}
and corresponding output from nm:
lib_printw.o:
U _nc_printf_string
00000000 t gcc2_compiled.
0000003c T mvprintw
00000078 T mvwprintw
00000000 T printw
U stdscr
000000b0 T vwprintw
U waddnstr
U wmove
00000020 T wprintw
So I assume I'm not looking at the same thing you are.