bug-ncurses
[Top][All Lists]
Advanced

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

Re: color in subwindows


From: D. Stimits
Subject: Re: color in subwindows
Date: Tue, 17 Jun 2003 13:53:55 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021018

Thomas Dickey wrote:

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.

I found something interesting, on a debug compile. How is the file llib-lncurses used? Using the most recent roll-up patch 20030510, and comparing this file from one I did a debug build on a couple months ago, I see that the newest one has const on fmt, but the debug version does not (I am not currently linking against the debug version, but the rpm for the binary was created from it). That llib-lncurses file seems to be the key, as on the older one it has this:
#undef mvprintw
int     mvprintw(
                int     y,
                int     x,
                char    *fmt,
                ...)
                { return(*(int *)0); }

On this older one it removes the const version and puts non-const back in. I guess what I need is a new rpm based on all of the patches that have been out since 5.3, rather than one based on only part of the patches.

D. Stimits, stimits AT attbi DOT com





reply via email to

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