Coder Social home page Coder Social logo

Comments (5)

zoul avatar zoul commented on July 29, 2024

Yes, we use the symbol later on line 147 and since it’s not defined on older systems, that code would crash there, so we need to do an availability check.

I wonder why I am not getting that warning… I guess that’s again CocoaPods: since they pull the naked files into a different framework, the build settings may be different. The code is correct, so I guess we might simply disable the warning for the particular piece of code. I’m just not happy to introduce changes that are only needed because CocoaPods can’t simply take the framework as defined by our project, sigh.

Can you try this pragma please?

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
// Give VoiceOver users feedback on the result. Requires at least 10.9 to run.
if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) {
    NSString* msg = _shortcutValue ?
                     MASLocalizedString(@"Shortcut set", @"VoiceOver: Shortcut set") :
                     MASLocalizedString(@"Shortcut cleared", @"VoiceOver: Shortcut cleared");
    NSDictionary *announcementInfo = @{
        NSAccessibilityAnnouncementKey : msg,
        NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh),
    };
    NSAccessibilityPostNotificationWithUserInfo(self, NSAccessibilityAnnouncementRequestedNotification, announcementInfo);
}
#pragma clang diagnostic pop

from masshortcut.

zoul avatar zoul commented on July 29, 2024

FYI, a1eeb57 is the crash fix with some detailed info.

from masshortcut.

beaufour avatar beaufour commented on July 29, 2024

Thanks for the rapid answer!

I guess it is not strictly a CocoaPods thing. If I manually import your sources into my project and have -Wall enabled I'll probably get it too. The above pragma takes care of the warning. This is a bit of a more precise "cut" though:

-    if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-compare"
+    BOOL accessibilityAvailable = (&NSAccessibilityPriorityKey != NULL);
+#pragma clang diagnostic pop
+    if (_recording == NO && accessibilityAvailable) {

from masshortcut.

zoul avatar zoul commented on July 29, 2024

I consider the build process to be a private implementation detail of the framework that should be encapsulated from the consumer. That’s why I’m not very happy about anyone pulling the naked source files and compiling them by hand. The downsides should be obvious in the light of the two last issues: there’s simply too much to be broken. And that’s why I like Carthage better than CocoaPods, although I use both – and greatly admire the polish and the work that went into the CocoaPods infrastructure. Philosophical excursions aside :–), I’ll try to fix this as soon as possible, hopefully by tomorrow.

from masshortcut.

beaufour avatar beaufour commented on July 29, 2024

I consider the build process to be a private implementation detail of the framework that should be encapsulated from the consumer. That’s why I’m not very happy about anyone pulling the naked source files and compiling them by hand. The downsides should be obvious in the light of the two last issues: there’s simply too much to be broken. And that’s why I like Carthage better than CocoaPods, although I use both – and greatly admire the polish and the work that went into the CocoaPods infrastructure.

That is a valid viewpoint, and also how most frameworks are shipped :) There is actually something nice about enforcing the same build warnings etc through all the source, but it is not exactly something I feel strongly about

Philosophical excursions aside :–), I’ll try to fix this as soon as possible, hopefully by tomorrow.

😄

from masshortcut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.