Opened 9 months ago

Last modified 9 months ago

#72239 assigned defect

emacs-app: error: expected a type

Reported by: rmottola (Riccardo) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version:
Keywords: mavericks Cc:
Port: emacs-app

Description (last modified by ryandesign (Ryan Carsten Schmidt))

nsterm.m:7057:4: error: expected a type
- (nullable NSAttributedString *)
   ^
nsterm.m:7059:20: error: expected a type
                          actualRange: (nullable NSRangePointer) actualRange
                                        ^
nsterm.m:7065:20: error: expected a type
                          actualRange: (nullable NSRangePointer) actualRange
                                        ^
nsterm.m:7059:45: warning: conflicting parameter types in implementation of 'attributedSubstringForProposedRange:actualRange:': 'NSRangePointer' (aka 'struct _NSRange *') vs 'id' [-Wmismatched-parameter-types]
                          actualRange: (nullable NSRangePointer) actualRange
                                                                 ^
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:47:105: note: previous definition is here
- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange;
                                                                                         ~~~~~~~~~~~~~~ ^
nsterm.m:7065:45: warning: conflicting parameter types in implementation of 'firstRectForCharacterRange:actualRange:': 'NSRangePointer' (aka 'struct _NSRange *') vs 'id' [-Wmismatched-parameter-types]
                          actualRange: (nullable NSRangePointer) actualRange
                                                                 ^
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:55:82: note: previous definition is here
- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange;
                                                                  ~~~~~~~~~~~~~~ ^
nsterm.m:9357:15: warning: instance method '-setTabbingMode:' not found (return type defaults to 'id') [-Wobjc-method-access]
        [self setTabbingMode:NSWindowTabbingModeDisallowed];
              ^~~~~~~~~~~~~~
./nsterm.h:419:12: note: receiver is instance of class declared here
@interface EmacsWindow : NSWindow
           ^
nsterm.m:9443:13: warning: instance method '-setAccessibilitySubrole:' not found (return type defaults to 'id') [-Wobjc-method-access]
      [self setAccessibilitySubrole:NSAccessibilityFloatingWindowSubrole];
            ^~~~~~~~~~~~~~~~~~~~~~~
./nsterm.h:419:12: note: receiver is instance of class declared here
@interface EmacsWindow : NSWindow
           ^
nsterm.m:9445:13: warning: instance method '-setAccessibilitySubrole:' not found (return type defaults to 'id') [-Wobjc-method-access]
      [self setAccessibilitySubrole:NSAccessibilityStandardWindowSubrole];
            ^~~~~~~~~~~~~~~~~~~~~~~
./nsterm.h:419:12: note: receiver is instance of class declared here
@interface EmacsWindow : NSWindow
           ^
nsterm.m:9444:5: warning: add explicit braces to avoid dangling else [-Wdangling-else]
    else
    ^
6 warnings and 3 errors generated.

Attachments (1)

emacs-nsterm.diff (665 bytes) - added by rmottola (Riccardo) 9 months ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: mavericks added
Owner: set to drkp
Status: newassigned
Summary: emacs-app fails to compile 10.9 Mavericks - error: expected a typeemacs-app: error: expected a type

Changed 9 months ago by rmottola (Riccardo)

Attachment: emacs-nsterm.diff added

comment:2 Changed 9 months ago by rmottola (Riccardo)

Working patch attached. I wonder if this is an issue of macports clang used vs. Xcode clang or older version of SDK.

comment:3 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Perhaps all of the above. Nullability is a Swift language feature that was brought back to Objective-C in Xcode 6.3. It likely includes both changes in Clang to support this feature and changes in the SDK to make use of it. See Nullability and Objective-C.

You didn't attach a main.log or indicate your Xcode version but according to XcodeVersionInfo, Xcode 6.3 requires OS X 10.10 or later and you said you're on 10.9 so you must have an earlier Xcode version than that.

You didn't show enough of the log to see whether the Clang that was used came from Xcode or MacPorts. Using a newer Clang from MacPorts likely gives you nullability support, but I'm not sure if the code will compile against an older pre-nullability SDK.

Your patch is likely wrong for newer compilers and SDKs that support nullability so I do not recommend applying it to newer compilers or SDKs. I also don't know whether it is correct for older compilers or SDKs. I recommend reporting the problem to the developers of emacs-app so they can decide how or if to fix it.

Note: See TracTickets for help on using tickets.