discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warning with clang, error with gcc


From: Bertrand Dekoninck
Subject: Warning with clang, error with gcc
Date: Mon, 29 Apr 2019 10:39:15 +0200
User-agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi, everyone on the list.

I'm facing an issue here and I don't find a solution.

I have a warning compiling the class RikScrollerArrowCell from the rik theme. I've got two warnings that causes an error with gcc (without libobjc2) but only one warning and no error with clang+libobjc2.

Here are the build logs :

with gcc :

RikScrollerArrowCell.m: In function ‘-[RikScrollerArrowCell drawBezelWithFrame:inView:]’: RikScrollerArrowCell.m:13:3: warning: ‘RikScrollerArrowCell’ may not respond to
‘-themeControlState’
   GSThemeControlState buttonState = [self themeControlState];
   ^
RikScrollerArrowCell.m:13:3: warning: (Messages without a matching method signature RikScrollerArrowCell.m:13:3: warning: will be assumed to return ‘id’ and accept
RikScrollerArrowCell.m:13:3: warning: ‘...’ as arguments.)
RikScrollerArrowCell.m:13:37: error: incompatible types when initializing type ‘GSThemeControlState’ using type ‘id’
   GSThemeControlState buttonState = [self themeControlState];
                                     ^
RikScrollerArrowCell.m:14:3: warning: ‘RikScrollerArrowCell’ may not respond to
‘-pathForFrame:’
   NSBezierPath * path = [self pathForFrame: cellFrame];
   ^
make[3]: *** [obj/Rik.obj/RikScrollerArrowCell.m.o] Error 1
make[2]: *** [internal-bundle-run-compile-submake] Error 2
make[1]: *** [Rik.all.bundle.variables] Error 2
make: *** [internal-all] Error 2


And with clang+libobjc2 :

Compiling file RikScrollerArrowCell.m ...
RikScrollerArrowCell.m:13:43: warning: instance method '-themeControlState' not
      found (return type defaults to 'id') [-Wobjc-method-access]
  GSThemeControlState buttonState = [self themeControlState];
                                          ^~~~~~~~~~~~~~~~~
./RikScrollerArrowCell.h:10:12: note: receiver is instance of class declared here
@interface RikScrollerArrowCell : NSButtonCell
           ^
RikScrollerArrowCell.m:13:23: warning: incompatible pointer to integer conversion
      initializing 'GSThemeControlState' with an expression of type 'id'
      [-Wint-conversion]
  GSThemeControlState buttonState = [self themeControlState];
                      ^             ~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
 Compiling file NSBrowserCell+Rik.m ...


I don't think it's an objc2 vs objc1 issue. RikScrollerArrowCell is a NSButtonCell subclass. Should'nt it respond to themeControlState ? The best would be to get rid of the warning and I don't understand why it occurs.

Here are attached RikScrollerArrowCell.m and RikScrollerArrowCell.h.


Any idea ?

Bertrand





reply via email to

[Prev in Thread] Current Thread [Next in Thread]