This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
objc/7014: Wrong compiler's warning
- From: daa at orcsoftware dot spb dot ru
- To: gcc-gnats at gcc dot gnu dot org
- Date: 13 Jun 2002 10:40:18 -0000
- Subject: objc/7014: Wrong compiler's warning
- Reply-to: daa at orcsoftware dot spb dot ru
>Number: 7014
>Category: objc
>Synopsis: Wrong compiler's warning
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jun 13 03:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Aleksey Dukhnyakov
>Release: gcc 3.1
>Organization:
>Environment:
>Description:
Extra warning
[daa@coke Tests]$ cat bug.m
#include <objc/objc.h>
@protocol MyProtocol
- (void) foo;
@end
int main()
{
id<MyProtocol> obj;
#if !defined(WORKAROUND)
if ( nil != obj )
#else
if ( obj != nil )
#endif
return 1;
return 0;
}
[daa@coke Tests]$ ~/bin/gcc -v
Reading specs from /home/daa/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ./configure : (reconfigured) ./configure
Thread model: single
gcc version 3.1
[daa@coke Tests]$ ~/bin/gcc bug.m
bug.m: In function `main':
bug.m:12: warning: comparison of distinct pointer types lacks a cast
[daa@coke Tests]$ ~/bin/gcc bug.m -DWORKAROUND
[daa@coke Tests]$
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: