public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug objc/32995] New: False warning when implementing an instance method called `dealloc' @ 2007-08-05 13:54 vgeddes at gnome dot org 2007-08-05 13:56 ` [Bug objc/32995] " vgeddes at gnome dot org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: vgeddes at gnome dot org @ 2007-08-05 13:54 UTC (permalink / raw) To: gcc-bugs uname -a: Linux ubuntu 2.6.20-16-generic #2 SMP Thu Jun 7 19:00:28 UTC 2007 x86_64 GNU/Linux gcc -v: Target: x86_64-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu Thread model: posix gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) command line and warning: gcc -DHAVE_CONFIG_H -I. -I.. -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DGNOME_VFS_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -fconstant-string-class=IString -fobjc-exceptions -g -O2 -MT libobjective_gnome_1_0_la-IObject.lo -MD -MP -MF .deps/libobjective_gnome_1_0_la-IObject.Tpo -c IObject.m -fPIC -DPIC -o .libs/libobjective_gnome_1_0_la-IObject.o IObject.m:65: warning: method possibly missing a [super dealloc] call I have implemented an object `IObject' which subclasses the `Object' class included the default Objective-C GNU runtime. For stylistic compatibility with the Cocoa and GNUstep frameworks, I have implemented a method called `dealloc' on `IObject'. `Object' does not define this method. When compiling this `IObject', I get this warning: IObject.m:18: warning: method possibly missing a [super dealloc] call Now, there is no `dealloc' method on `Object', so the warning is false. I understand that the warning makes sense when using Cocoa or GNUstep, because their root objects all have `dealloc' defined. But this is not the case for the default GNU runtime. Maybe we should define `dealloc' on `Object'? -- Summary: False warning when implementing an instance method called `dealloc' Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: objc AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: vgeddes at gnome dot org GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32995 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug objc/32995] False warning when implementing an instance method called `dealloc' 2007-08-05 13:54 [Bug objc/32995] New: False warning when implementing an instance method called `dealloc' vgeddes at gnome dot org @ 2007-08-05 13:56 ` vgeddes at gnome dot org 2007-08-06 21:40 ` pinskia at gcc dot gnu dot org 2010-09-14 22:52 ` nicola at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: vgeddes at gnome dot org @ 2007-08-05 13:56 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from vgeddes at gnome dot org 2007-08-05 13:56 ------- Created an attachment (id=14025) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14025&action=view) IObject.mi Preprocessed file for IObject.m -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32995 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug objc/32995] False warning when implementing an instance method called `dealloc' 2007-08-05 13:54 [Bug objc/32995] New: False warning when implementing an instance method called `dealloc' vgeddes at gnome dot org 2007-08-05 13:56 ` [Bug objc/32995] " vgeddes at gnome dot org @ 2007-08-06 21:40 ` pinskia at gcc dot gnu dot org 2010-09-14 22:52 ` nicola at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu dot org @ 2007-08-06 21:40 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from pinskia at gcc dot gnu dot org 2007-08-06 21:40 ------- well to some extend dealloc is special method which is why the warning is there. Also dealloc does not belong to the the original Object class (which is based on the old NX Object base class). This is true of the NeXT runtime Object too. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- GCC target triplet|x86_64-linux-gnu | Summary|False warning when |False warning when |implementing an instance |implementing an instance |method called `dealloc' |method called `dealloc' http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32995 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug objc/32995] False warning when implementing an instance method called `dealloc' 2007-08-05 13:54 [Bug objc/32995] New: False warning when implementing an instance method called `dealloc' vgeddes at gnome dot org 2007-08-05 13:56 ` [Bug objc/32995] " vgeddes at gnome dot org 2007-08-06 21:40 ` pinskia at gcc dot gnu dot org @ 2010-09-14 22:52 ` nicola at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: nicola at gcc dot gnu dot org @ 2010-09-14 22:52 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from nicola at gcc dot gnu dot org 2010-09-14 22:52 ------- If you want to use dealloc for "compatibility" with Apple Cocoa / GNUstep Base, then you also want the warnings that dealloc needs to include a call to [super dealloc], so I wouldn't change the compiler ;-) You could change your code though - if you're triyng to be compatible with Cocoa / GNUstep, then you may as well define an NSObject root class and have a dealloc method in it ;-) If you still want to use Object, you can add a -dealloc method to Object by using a category: @interface Object (dealloc) - (void) dealloc; @end (the add the implementation). Then you can have the missing [super dealloc] in your subclass, and the compiler won't generate any warnings. Thanks -- nicola at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32995 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-14 22:52 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-08-05 13:54 [Bug objc/32995] New: False warning when implementing an instance method called `dealloc' vgeddes at gnome dot org 2007-08-05 13:56 ` [Bug objc/32995] " vgeddes at gnome dot org 2007-08-06 21:40 ` pinskia at gcc dot gnu dot org 2010-09-14 22:52 ` nicola at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).