This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

objc/7014: Wrong compiler's warning


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]