Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode [Redacted] Hates Uninitialized Compares #221

Closed
CodaFi opened this issue Nov 5, 2012 · 1 comment
Closed

Xcode [Redacted] Hates Uninitialized Compares #221

CodaFi opened this issue Nov 5, 2012 · 1 comment

Comments

@CodaFi
Copy link

CodaFi commented Nov 5, 2012

In the newest Xcode, Sparkle will not compile because SUPipedUnarchiver uses a very weird compare from a goto here:

finally:
    if (fp)
        fclose(fp);
    if (oldDestinationString)
        setenv("DESTINATION", oldDestinationString, 1);
    else
        unsetenv("DESTINATION");
    [pool release];

Which stems from some Macros tripping up the compiler here:

#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
    NSNumber *fs = [[[NSFileManager defaultManager] fileAttributesAtPath:archivePath traverseLink:NO] objectForKey:NSFileSize];
#else
    NSNumber *fs = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil] objectForKey:NSFileSize];
#endif

Xcode complains of "oldDestinationString being used uninitialized whenever the 'if' condition is true."

I would rather not have to do a clang diagnostic push/pop, or outright remove those statements there to get this to work.

@andymatuschak
Copy link
Contributor

A legitimate complaint!

lksoft added a commit to lksoft/Sparkle that referenced this issue Jul 3, 2013
* matuschak/master: (46 commits)
  Fixing issue with update as non admin user where the quarantine flag did not get correctly removed from new application
  Release notes referenced by URL in updates item description field can be delivered via https://
  Fix stuffing unsigned int into int variable, causing build warning
  Update Project file/Scheme to recommended Xcode settings
  Fix "corrupted" turkish strings file
  update .gitignore
  Fixed warnings in xibs, switched to lldb and fixed occasional copy phase error from incorrect text encoding
  Add explicit method return types in header to supress warnings when including framework in projects with more exacting warnings such as -Wextra.
  Fall back on DSA-only installation checks for .pkg installations
  Fixes sparkle-project#222: Long version ids (12 digits based on reverse date) cause update to work no longer
  Fixed unit tests for 10.8
  Fixes sparkle-project#221: char *oldDestinationString
  Updates to Turkish localization courtesy Emir Sarı
  Update remaining english straight single ' quotes to curly ’ quotes
  Update strings files to standardize ellipsis character (…) instead of three dots (…) Also change don't to curly quote don’t in dialog.
  Adding Arabic localization, courtesy Muhammad Azmi Al-Hashemi
  Disable row selection in the system profile table by implementing the table delegate and turning off "Avoid Empty Selection", "Preserve Selection" and "Select Inserted Objects" on the array controller in the nib.
  Fixes sparkle-project#198: Problem with 10.5
  Fixes sparkle-project#133: Sparkle deleting/replacing the wrong executable when it unpacks
  Adding Thai localizations to the project.
  ...

Conflicts:
	SUHost.m
	Sparkle.xcodeproj/project.pbxproj
	Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants