From: <no...@so...> - 2002-04-26 13:55:06
|
Bugs item #549082, was opened at 2002-04-26 13:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=549082&group_id=2435 Category: gcc Group: Feature requests Status: Open Resolution: None Priority: 5 Submitted By: Aleksey Dukhnyakov (daa77) Assigned to: Danny Smith (dannysmith) Summary: cc1obj output wrong warnings Initial Comment: Please see testcase: # cat foo.m #import <objc/Object.h> @protocol MyObject - print; @end @protocol MyCopying - copy; @end @interface MyObject : Object <MyObject> @end @implementation MyObject - print { printf("Hello World !\n"); } @end @protocol NextObject <MyObject, MyCopying> @end @interface NextObject : MyObject <NextObject> - show; @end @implementation NextObject - show { printf("-[NextObject show]\n"); } - copy { } @end int main() { NextObject * obj = [NextObject new]; [obj print]; [obj free]; } # gcc foo.m -lobjc foo.m:37: warning: incomplete implementation of class `NextObject' foo.m:37: warning: method definition for `-print' not found foo.m:37: warning: class `NextObject' does not fully implement the `MyObject' protocol # a.exe Hello World ! # gcc -v Reading specs from d:/mingw_new/bin/../lib/gcc- lib/mingw32/2.95.3-5/specs gcc version 2.95.3-5 (mingw special) But If I change @protocol NextObject <MyObject, MyCopying> to @protocol NextObject <MyObject> Compiler works properly. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=549082&group_id=2435 |
From: <no...@so...> - 2002-04-26 23:40:04
|
Bugs item #549082, was opened at 2002-04-27 01:54 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=549082&group_id=2435 Category: gcc Group: Feature requests >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Aleksey Dukhnyakov (daa77) Assigned to: Danny Smith (dannysmith) Summary: cc1obj output wrong warnings Initial Comment: Please see testcase: # cat foo.m #import <objc/Object.h> @protocol MyObject - print; @end @protocol MyCopying - copy; @end @interface MyObject : Object <MyObject> @end @implementation MyObject - print { printf("Hello World !\n"); } @end @protocol NextObject <MyObject, MyCopying> @end @interface NextObject : MyObject <NextObject> - show; @end @implementation NextObject - show { printf("-[NextObject show]\n"); } - copy { } @end int main() { NextObject * obj = [NextObject new]; [obj print]; [obj free]; } # gcc foo.m -lobjc foo.m:37: warning: incomplete implementation of class `NextObject' foo.m:37: warning: method definition for `-print' not found foo.m:37: warning: class `NextObject' does not fully implement the `MyObject' protocol # a.exe Hello World ! # gcc -v Reading specs from d:/mingw_new/bin/../lib/gcc- lib/mingw32/2.95.3-5/specs gcc version 2.95.3-5 (mingw special) But If I change @protocol NextObject <MyObject, MyCopying> to @protocol NextObject <MyObject> Compiler works properly. ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2002-04-27 11:40 Message: Logged In: YES user_id=11494 Thanks for the testcase. This is fixed in GCC 3.1. Here is the results with: > gcc foo.m -Wall -lobjc D:\develop\bugs>gcc foo.m -Wall -lobjc foo.m:1:2: warning: #import is obsolete, use an #ifndef wrapper in the header file foo.m: In function `-[MyObject print]': foo.m:19: warning: control reaches end of non-void function foo.m: In function `-[NextObject show]': foo.m:33: warning: control reaches end of non-void function foo.m: In function `-[NextObject copy]': foo.m:36: warning: control reaches end of non-void function foo.m: In function `main': foo.m:46: warning: control reaches end of non-void function Your warning is gone. I do get other legitimate warnings. Danny ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=549082&group_id=2435 |