wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.77k stars 1.7k forks source link

confilct between wx/memory.h and /usr/include/c++/3.2.3/new #21257

Closed wxtrac closed 11 years ago

wxtrac commented 19 years ago

Issue migrated from trac ticket # 1892

component: build | priority: low | resolution: wontfix

2004-09-21 21:09:57: pamg created the issue


The conflict shows up only when building wx-2.5.2 in DEBUG mode (with memory tracing enabled, etc.) under Linux (2.4.21):

./bk-deps g++ -c -o basedll_log.o -DWXGTK
-DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -fPIC -DWXDEBUG -Ilib/wx/include/gtkd-2.5 -I../../../include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -D_REENTRANT -I/usr/X11R6/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -ggdb -O0 -pthread -Wall ../../../src/common/log.cpp In file included from /usr/include/c++/3.2.3/bits/stl_algobase.h:69, from /usr/include/c++/3.2.3/memory:54, from /usr/include/c++/3.2.3/string:48, from /usr/include/c++/3.2.3/bits/localefwd.h:49, from /usr/include/c++/3.2.3/ios:48, from /usr/include/c++/3.2.3/ostream:45, from /usr/include/c++/3.2.3/iostream:45, from ../../../include/wx/ioswrap.h:17, from ../../../src/common/log.cpp:568: /usr/include/c++/3.2.3/new:79: declaration of void* operator new(unsigned int) throw (std::bad_alloc)' throws different exceptions ../../../include/wx/memory.h:79: than previous declarationvoid operator new(unsigned int)' /usr/include/c++/3.2.3/new:80: declaration of `void operator new [](unsigned int) throw (std::bad_alloc)' throws different exceptions ../../../include/wx/memory.h:90: than previous declaration void* operator new [](unsigned int)' /usr/include/c++/3.2.3/new:81: declaration ofvoid operator delete(void) throw ()' throws different exceptions ../../../include/wx/memory.h:84: than previous declaration `void operator delete(void)' /usr/include/c++/3.2.3/new:82: declaration of void operator delete [](void*) throw ()' throws different exceptions ../../../include/wx/memory.h:100: than previous declarationvoid operator delete ' gmake: *** [basedll_log.o] Error 1

wxtrac commented 19 years ago

2004-09-21 21:14:58: pamg commented


Additional comments/observations:

It appears that wx/memory.h is completely unaware of the '97 ANSI additions to the C++ language, such as exception specifications, namespaces, etc.

This is fine with me, but the configure script must address platforms in which the new C++ libraries/includes are installed by default (such as Red Hat Enterprise Linux AS release 3 (Taroon)).

Either modify wx/memory.h, or produce a makefile that disables error checking by the compiler of exception specifications.

wxtrac commented 19 years ago

2004-09-21 22:06:59: pamg commented


Additional comments/observations:

It appears that wx/memory.h is completely unaware of the '97 ANSI additions to the C++ language, such as exception specifications, namespaces, etc.

This is fine with me, but the configure script must address platforms in which the new C++ libraries/includes are installed by default (such as Red Hat Enterprise Linux AS release 3 (Taroon)).

Either modify wx/memory.h, or produce a makefile that disables error checking by the compiler of exception specifications.

wxtrac commented 19 years ago

2004-09-21 23:43:41: @vadz commented


The best thing to do is not to use wx memory debugging code at all. There are separate libraries and toosl (valgrind, efence, dmalloc, mpatrol, ...) which do it much better.

wxtrac commented 19 years ago

2004-11-07 00:20:08: ryannpcs commented


Closed - we don't use exceptions(currently)

wxtrac commented 19 years ago

2004-11-07 19:24:05: @vadz commented


Sorry Ryan but what does your observation have to do with this bug report? The bug is still valid as wx memory debugging code does not work compile with gcc 3.x...

wxtrac commented 15 years ago

2008-07-04 00:42:06: Peter Most (Peter_Most) commented


Can somebody tell me how I have to configure wxWidgets to reproduce this compiler error? I tried with:

configure --enable-debug --enable-debug_flag --enable-mem_tracing --disable-gui --disable-debug_cntxt --enable-stl --enable-log --enable-std_iostreams --enable-std_string

but I'm always getting this compiler error:

../src/common/memory.cpp: In member function ‘void wxMemStruct::Dump()’: ../src/common/memory.cpp:373: error: no matching function for call to ‘wxDebugContext::OutputDumpLine(wxString&)’ ../include/wx/memory.h:311: note: candidates are: static void wxDebugContext::OutputDumpLine(const wxChar, ...) ../src/common/memory.cpp:384: error: no matching function for call to ‘wxDebugContext::OutputDumpLine(wxString&)’ ../include/wx/memory.h:311: note: candidates are: static void wxDebugContext::OutputDumpLine(const wxChar, ...) ../src/common/memory.cpp: In static member function ‘static bool wxDebugContext::Dump()’: ../src/common/memory.cpp:596: error: invalid cast from type ‘wxString’ to type ‘const wxChar’ ../src/common/memory.cpp:597: error: invalid cast from type ‘wxString’ to type ‘const wxChar’ ../src/common/memory.cpp: In static member function ‘static bool wxDebugContext::PrintStatistics(bool)’: ../src/common/memory.cpp:652: error: invalid cast from type ‘wxString’ to type ‘const wxChar’ ../src/common/memory.cpp:653: error: invalid cast from type ‘wxString’ to type ‘const wxChar’ ../src/common/memory.cpp: In static member function ‘static bool wxDebugContext::PrintClasses()’: ../src/common/memory.cpp:746: error: invalid cast from type ‘wxString’ to type ‘const wxChar*’

wxtrac commented 12 years ago

2012-01-09 11:15:47: @oneeyeman1 commented


FWIW, here is my configure line:

../configure --with-libpng=no --with-libjpeg=no --with-libtiff=no --with-zlib=no --with-expat=no --disable-gif --disable-pcx --disable-tga --disable-iff --disable-pnm --disable-accessibility --disable-apple_ieee --enable-profile --enable-mem_tracing --enable-debug_gdb --enable-debug --disable-ps-in-msw --enable-debug_cntxt --disable-svg

The library builds fine on my Gentoo Linux.

igor@IgorsGentooOnNetwork ~/wxWidgets/buildGTK/samples/event $ emerge --info Portage 2.1.10.11 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.11.3-0, 2.6.36-gentoo-8 i686)

System uname: Linux-2.6.36-gentoo-8-i686-Genuine_Intel-R-_CPUT1350@_1.86GHz-with-gentoo-1.12.14 Timestamp of tree: Sun, 18 Dec 2011 08:15:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 4.1_p9 dev-lang/python: 2.6.6-2, 3.1.3-1 dev-util/ccache: 2.4-9 dev-util/cmake: 2.8.1-2 dev-util/pkgconfig: 0.25-2 sys-apps/baselayout: 1.12.14-1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13, 2.65-1 sys-devel/automake: 1.11.1 sys-devel/binutils: 2.20.1-1 sys-devel/gcc: 4.4.5 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-2 sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers) sys-libs/glibc: 2.11.3 Repositories: gentoo x-portage ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1" CBUILD="i686-pc-linux-gnu" CFLAGS="-Os -march=prescott -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-Os -march=prescott -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs ccache distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://gentoo.osuosl.org/ " LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="X a52 acl acpi alsa apm berkdb bzip2 cdr clamav cli consolekit cracklib crypt cxx dbus dri dvd dvdr freetds gdbm gnome gpm gtk gtk2 iconv ipv6 lm_sensors modules mplayer mssql mudflap mysql ncurses nls nptl nptlonly odbc opengl openmp pam pcre pmu policykit pppd pulseaudio readline session ssl sybase sybase-ct symlink sysfs tcpd theora truetype udev unicode usb wifi wxwindows x86 xine xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev mouse keyboard synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Can this be closed or it needs verification with gcc 3.x as the OP was about that version?

wxtrac commented 12 years ago

2012-01-09 13:20:17: @vadz commented


I think the conflict in operator new declarations is still possible.

wxtrac commented 12 years ago

2012-01-11 03:17:14: @oneeyeman1 commented


It would be nice to know the OP configuration... Or maybe Vadim can give the possibles to check?

wxtrac commented 11 years ago

2012-12-03 03:15:16: @oneeyeman1 commented


Vadim,

Replying to [comment:8 vadz]:

I think the conflict in operator new declarations is still possible.

Did you mean conflict with memory.h and operator new()?

wxtrac commented 11 years ago

2012-12-03 03:34:29: @oneeyeman1 commented


FWIW, I just built the library in Peter's configuration.

This is what I have on my machine:

igor@IgorReinCloud ~/wxWidgets/build1892 $ emerge --info Portage 2.1.11.31 (default/linux/amd64/10.0/desktop/gnome, gcc-4.4.5, glibc-2.15-3, 3.1.6-gentoo x86_64)

System uname: Linux-3.1.6-gentoo-x86_64-AMD_E-350_Processor-with-gentoo-2.1 Timestamp of tree: Thu, 15 Nov 2012 19:15:01 +0000 ld GNU ld (GNU Binutils) 2.22 app-shells/bash: 4.2_p37 dev-java/java-config: 2.1.11-3 dev-lang/python: 2.7.3-2, 3.1.3-1 dev-util/cmake: 2.8.9 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.1-1 sys-apps/openrc: 0.9.8.4 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-3, 1.11.6 sys-devel/binutils: 2.22-1 sys-devel/gcc: 4.4.5 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4-1 sys-devel/make: 3.82-3 sys-kernel/linux-headers: 3.4-2 (virtual/os-headers) sys-libs/glibc: 2.15-3 Repositories: gentoo x-portage ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA PUEL Oracle-BCLA-JavaSE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=barcelona -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=barcelona -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.osuosl.org/" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 apm berkdb bluetooth branding bzip2 cairo cdda cdr clamav cli colord consolekit cracklib crypt cxx dbus djvu dri dts dvd dvdr eds emboss encode evo exif fam firefox flac freetds gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv ipv6 java6 jpeg lcms ldap libnotify lm_sensors mad mmx mng modules mozilla mp3 mp4 mpeg mssql mudflap multilib mysql nautilus ncurses nls nptl odbc ogg opengl openmp oracle pam pango pch pcmcia pcre pdf perl png policykit ppds pppd pulseaudio qt3support readline sdl session socialweb spell sqlite sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

wxtrac commented 11 years ago

2013-04-20 03:42:07: @oneeyeman1 commented


Vadim, Can we remove memory check code from wx sources. As mentioned people need to use valgrind for that.

wxtrac commented 11 years ago

2013-04-20 13:15:33: @vadz changed status from new to closed

2013-04-20 13:15:33: @vadz changed resolution from * to wontfix*