pkgsrc-Bugs archive

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

Re: pkg/32670: multimedia/vlc (in pkgsrc-2005Q4) does not compile [with fix]



On Mon 30 Jan 2006 at 20:30:02 +0000, joerg%britannica.bec.de@localhost wrote:
>  This patches are incorrect or rather the use is absolutely correct.

Maybe the use is correct - yet it does not compile.

>From comp.std.c I have learned that NULL should always be cast to the
correct type. In C++ where more type conversions are made this seems
even more important.

>  Please check your build environment where the incorrect (C-style void *)
>  declaration of NULL comes from.

My build environment is a plain 3.0/amd64 into a chroot made with
pkg_comp.  Of course I have my preferences in /etc/mk.conf but none that
would influence NULL, I'd say (and if they did I would call it a bug).

I recall another package that needed similar fixes before, also due to
wxWidgets, but I don't remember which it was (maybe it was even vlc).

I don't think a C-style (void *) version of NULL is the problem, since the
compiler complains about ambiguous overloading, and the arguments it
can't decide between are const wxString* and long int. That could happen
only if NULL is 0, not if it is (void *)0. (Aside: even in C NULL should
not be defined as (void *)0 since it that is a data pointer, and those
cannot be converted to a function pointer, i.e. (void (*)())NULL would
fail to compile).

Looking at the error message which prints "NULL" explicitly it would
even seem that it doesn't matter - that g++ is painfully aware of the
NULLness of the pointer.

With some trouble I got the pre-processed text (g++ -E -dD -C) and this
is how it defines NULL:

# 1 "/usr/include/sys/null.h" 1 3 4
/*      $NetBSD: null.h,v 1.6 2003/10/24 21:45:09 enami Exp $   */ 
# 11 "/usr/include/sys/null.h" 3 4
#define NULL __null 

I expect that this definition can hardly be improved. From the errors, I
conclude that __null behaves as plain 0.

pkg_comp:default.conf# gcc -v
Using built-in specs.
Configured with: 
/home/nick/work/netbsd/src/tools/gcc/../../gnu/dist/gcc/configure 
--enable-long-long --disable-multilib --enable-threads --disable-symvers 
--build=i386-unknown-netbsdelf2.0. --host=x86_64--netbsd --target=x86_64--netbsd
Thread model: posix
gcc version 3.3.3 (NetBSD nb3 20040520)

These are the errors (there are lots of warnings too):

if c++ -DHAVE_CONFIG_H -I. -I. -I../../..   -I/usr/pkg/include -I/usr/include -D
GLX_GLXEXT_LEGACY -I/usr/pkg/include/freetype2 -I/usr/X11R6/include -DSYS_NETBSD
 -I../../../include `top_builddir="../../.." ../../../vlc-config --cxxflags plug
in wxwindows` -Wsign-compare -Wsign-compare -Wall -O2 -I/usr/pkg/include -I/usr/
include -DGLX_GLXEXT_LEGACY -I/usr/pkg/include/freetype2 -I/usr/X11R6/include -p
thread -finline-limit-30000 -pipe -MT libwxwindows_plugin_a-open.o -MD -MP -MF "
.deps/libwxwindows_plugin_a-open.Tpo" \
  -c -o libwxwindows_plugin_a-open.o `test -f 'open.cpp' || echo './'`open.cpp; 
\
then mv -f ".deps/libwxwindows_plugin_a-open.Tpo" ".deps/libwxwindows_plugin_a-o
pen.Po"; \
else rm -f ".deps/libwxwindows_plugin_a-open.Tpo"; exit 1; \
fi

...

open.cpp: In constructor `wxvlc::OpenDialog::OpenDialog(intf_thread_t*,
   wxWindow*, int, int, int)':
open.cpp:385: error: call of overloaded `wxComboBox(wxPanel*&, <anonymous
   enum>, const char[1], wxPoint, wxSize, int, NULL)' is ambiguous
/pkg_comp/obj/pkgsrc/multimedia/vlc/default/.buildlink/include/wx-2.6/wx/gtk/com
bobox.h:65: error: candidates
   are: wxComboBox::wxComboBox(wxWindow*, int, const wxString&, const wxPoint&,
   const wxSize&, const wxArrayString&, long int, const wxValidator&, const
   wxString&)
/pkg_comp/obj/pkgsrc/multimedia/vlc/default/.buildlink/include/wx-2.6/wx/gtk/com
bobox.h:54: error:
                  wxComboBox::wxComboBox(wxWindow*, int, const wxString&, const
   wxPoint&, const wxSize&, int, const wxString*, long int, const wxValidator&,
   const wxString&)

open.cpp:442: warning: `__comp_ctor' is deprecated (declared at
   
/pkg_comp/obj/pkgsrc/multimedia/vlc/default/.buildlink/include/wx-2.6/wx/sizer.h
   :788)

open.cpp: In member function `wxPanel* wxvlc::OpenDialog::FilePanel(wxWindow*)
   ':
open.cpp:566: error: call of overloaded `wxComboBox(wxPanel*&, <anonymous
   enum>, const char[1], wxPoint, wxSize, int, NULL)' is ambiguous
/pkg_comp/obj/pkgsrc/multimedia/vlc/default/.buildlink/include/wx-2.6/wx/gtk/combobox.h:65:
 error: candidates
   are: wxComboBox::wxComboBox(wxWindow*, int, const wxString&, const wxPoint&,
   const wxSize&, const wxArrayString&, long int, const wxValidator&, const
   wxString&)
/pkg_comp/obj/pkgsrc/multimedia/vlc/default/.buildlink/include/wx-2.6/wx/gtk/combobox.h:54:
 error:
                  wxComboBox::wxComboBox(wxWindow*, int, const wxString&, const
   wxPoint&, const wxSize&, int, const wxString*, long int, const wxValidator&,
   const wxString&)

So, concluding, I can see why the compiler produces the error that it
does, it can't be that NULL is somehow (void *)0 which would be
incorrect for other reasons as well, and disambiguation of the NULL
argument makes a lot of sense. Hence, my patch.

>  Joerg
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.



Home | Main Index | Thread Index | Old Index