bug-ncurses
[Top][All Lists]
Advanced

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

Re: Fix build breaks in ncurses c++ binding


From: Adam Jiang
Subject: Re: Fix build breaks in ncurses c++ binding
Date: Mon, 4 Aug 2014 10:34:04 +0900

Sure. It makes sense to make sure we do have an issue by applying any changes. 
I guess the repo on my side is related to home-brew. I was actually trying to 
compile my code against brew-dupes/ncurses.

Attachment: test.cpp
Description: Binary data


Test code is attached. The issue could be reproduced by

$ brew tap homebrew/dupes
$ brew install ncurses
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
$ g++ -I/usr/local/opt/ncurses/include -L/usr/local/opt/ncurses/lib -lncurses++ 
-lncurses -lpanel -lmenu -o /tmp/anothertest /tmp/test.cpp

This issue is also reproducible on my Linux box with gcc version

$ g++ --version
g++ (Funtoo 4.8.2-r2) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

On 2014年8月3日, at 下午7:38, Thomas Dickey <address@hidden> wrote:

> On Sun, Aug 03, 2014 at 11:37:26AM +0900, Adam Jiang wrote:
>> Em…that was not true for the second issue. I can still get error message 
>> with code
>> 
>> =======
>> class UserData;
>> typedef NCursesUserPanel<UserData> UserPanel;
>> UserPanel *p = new UserPanel();
>> =======
>> 
>> 
>> In file included from src/cui.cpp:26:
>> In file included from src/cui.hpp:31:
>> In file included from /usr/local/opt/ncurses/include/ncursesw/cursesm.h:39:
>> /usr/local/opt/ncurses/include/ncursesw/cursesp.h:247:16: error: const_cast 
>> from 'const PowerData *' to 'void *' is not allowed
>>     set_user(const_cast<void *>(p_UserData));
>>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> src/cui.cpp:141:30: note: in instantiation of member function 
>> 'NCursesUserPanel<PowerData>::NCursesUserPanel' requested here
>> PowerMonitorPanel *p = new PowerMonitorPanel();
>> 
>> 
>> 
>> having ‘const_cast’ to convert ’T*’ to ‘void*’ is not a good choice no 
>> matter if compiler support this.
>> 
>> We need this patch.
> 
> yes: but my policy is to verify changes where I have a comparable environment.
> As I pointed out, the compiler on my machine gives the same version 
> information.
> 
> In my tests, I had no warnings.  So what I am looking for is details on how
> to reproduce the problem you are proposing to fix.
> 
> -- 
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net


reply via email to

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