Xcode Static Analyzer

RSS for tag

The Xcode Clang Static Analyzer finds bugs in Objective-C, C, and C++ code. It finds hard-to-produce, edge-case bugs without the need to run code and shows the sequence of steps along which the bug occurs.

Posts under Xcode Static Analyzer tag

5 Posts

Post

Replies

Boosts

Views

Activity

Reference to [symbol] is ambiguous, but it's the same symbol...
I've got a Project with a bunch of frameworks, each of which has a static library version of itself (for compiling command-line tools that also use the code). Compiling the frameworks goes fine. Compiling one of the static libraries (A Mime-parsing framework) is giving me the rather odd message that a bunch of symbols are ambiguous, but the ambiguity resolves to the same symbol in the error-message... ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:57:18: error: reference to 'E3_SMIME_ENVELOPED_DATA' is ambiguous 57 | case E3_SMIME_ENVELOPED_DATA: | ^ In file included from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:9: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:17:2: note: candidate found by name lookup is 'E3_SMIME_ENVELOPED_DATA' 17 | E3_SMIME_ENVELOPED_DATA, // Enveloped data | ^ In module 'E3Mime' imported from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:8: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:17:2: note: candidate found by name lookup is 'E3_SMIME_ENVELOPED_DATA' 17 | E3_SMIME_ENVELOPED_DATA, // Enveloped data | ^ ... and again ... ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:62:18: error: reference to 'E3_SMIME_SIGNED_DATA' is ambiguous 62 | case E3_SMIME_SIGNED_DATA: | ^ In file included from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:9: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:18:2: note: candidate found by name lookup is 'E3_SMIME_SIGNED_DATA' 18 | E3_SMIME_SIGNED_DATA, // Signed data | ^ In module 'E3Mime' imported from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:8: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:18:2: note: candidate found by name lookup is 'E3_SMIME_SIGNED_DATA' 18 | E3_SMIME_SIGNED_DATA, // Signed data | ^ ... and again, etc ... . No file inside the module (neither .m or .h) includes the module-header, the definition of the offending symbols looks like: // // E3AppPkcs7Part.h // E3Mime // #import <E3Mime/E3CryptoContext.h> #import <E3Mime/E3MimePart.h> #import <E3Mime/E3MimeMultipartEncrypted.h> NS_ASSUME_NONNULL_BEGIN typedef enum { E3_SMIME_COMPRESSED_DATA, // Compressed data E3_SMIME_ENVELOPED_DATA, // Enveloped data E3_SMIME_SIGNED_DATA, // Signed data E3_SMIME_CERTS_ONLY, // Only certificate data E3_SMIME_UNKNOWN, // Que ? } E3SMimeType; ... And when I click on the error adornment in the editor pane, the errors disappear. It still won't build the project, though. I just get the same errors the next time I press CMD-B. Can't upload a short screen-capture of that, so I put it the movie at http://0x0000ff.co.uk/mov/phantom-errors.mov.
1
0
44
1d
C function in library code gets stripped when distributed
This is a continuation of https://developer.apple.com/forums/thread/795348 I rambled too much and did not understand the underlaying problem. The problem is that I have a C function in a iOS library. I want to call this C function from a dylib that this library loads on runtime. When running directly from Xcode (either in debug or release mode) this works correctly. However, when the app is uploaded to testflight or distributed for debugging then the function is stripped and a null function pointer exception crashes the app. In the last post it was really hard to explain and I was pressed on time but I've created a minimal reproducible example: https://github.com/ospfranco/dylib_crash The instructions to run and reproduce the crash are on the README.
2
0
648
Jan ’26
Xcode Organizer is blowing up
An error occurred preventing Xcode from downloading version information from App Store Connect for account "xxxxxxxx". An unexpected error occurred: [<__NSDictionaryM 0x600003ed4fe0> valueForUndefinedKey:]: this class is not key value coding-compliant for the <app name! 5.00.12 (iOS App). I have no idea what the hell is causing this. I have checked all of the links between screens and objects and none are missing. This is a live active version on the store.
0
0
183
Nov ’25
Basic c++xcodeproj call to swift code
I have c++ macOs app(Xcode +14) and I try to add call to swift code. I can't find any simple c++ xcodeproj call to swift code. I create new simple project and fail to build it with error when I try to include #include <SwiftMixTester/SwiftMixTester-Swift.h>: main.m:9:10: error: 'SwiftMixTester/SwiftMixTester-Swift.h' file not found (in target 'CppCallSwift' from project 'CppCallSwift') note: Did not find header 'SwiftMixTester-Swift.h' in framework 'SwiftMixTester' (loaded from '/Users/yanivsmacm4/Library/Developer/Xcode/DerivedData/CppCallSwift-exdxjvwdcczqntbkksebulvfdolq/Build/Products/Debug') . Please help.
5
0
810
Oct ’25
Reference to [symbol] is ambiguous, but it's the same symbol...
I've got a Project with a bunch of frameworks, each of which has a static library version of itself (for compiling command-line tools that also use the code). Compiling the frameworks goes fine. Compiling one of the static libraries (A Mime-parsing framework) is giving me the rather odd message that a bunch of symbols are ambiguous, but the ambiguity resolves to the same symbol in the error-message... ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:57:18: error: reference to 'E3_SMIME_ENVELOPED_DATA' is ambiguous 57 | case E3_SMIME_ENVELOPED_DATA: | ^ In file included from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:9: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:17:2: note: candidate found by name lookup is 'E3_SMIME_ENVELOPED_DATA' 17 | E3_SMIME_ENVELOPED_DATA, // Enveloped data | ^ In module 'E3Mime' imported from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:8: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:17:2: note: candidate found by name lookup is 'E3_SMIME_ENVELOPED_DATA' 17 | E3_SMIME_ENVELOPED_DATA, // Enveloped data | ^ ... and again ... ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:62:18: error: reference to 'E3_SMIME_SIGNED_DATA' is ambiguous 62 | case E3_SMIME_SIGNED_DATA: | ^ In file included from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:9: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:18:2: note: candidate found by name lookup is 'E3_SMIME_SIGNED_DATA' 18 | E3_SMIME_SIGNED_DATA, // Signed data | ^ In module 'E3Mime' imported from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:8: ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:18:2: note: candidate found by name lookup is 'E3_SMIME_SIGNED_DATA' 18 | E3_SMIME_SIGNED_DATA, // Signed data | ^ ... and again, etc ... . No file inside the module (neither .m or .h) includes the module-header, the definition of the offending symbols looks like: // // E3AppPkcs7Part.h // E3Mime // #import <E3Mime/E3CryptoContext.h> #import <E3Mime/E3MimePart.h> #import <E3Mime/E3MimeMultipartEncrypted.h> NS_ASSUME_NONNULL_BEGIN typedef enum { E3_SMIME_COMPRESSED_DATA, // Compressed data E3_SMIME_ENVELOPED_DATA, // Enveloped data E3_SMIME_SIGNED_DATA, // Signed data E3_SMIME_CERTS_ONLY, // Only certificate data E3_SMIME_UNKNOWN, // Que ? } E3SMimeType; ... And when I click on the error adornment in the editor pane, the errors disappear. It still won't build the project, though. I just get the same errors the next time I press CMD-B. Can't upload a short screen-capture of that, so I put it the movie at http://0x0000ff.co.uk/mov/phantom-errors.mov.
Replies
1
Boosts
0
Views
44
Activity
1d
No eligible devices connected to 'My Mac
No eligible devices connected to 'My Mac
Replies
3
Boosts
0
Views
136
Activity
Feb ’26
C function in library code gets stripped when distributed
This is a continuation of https://developer.apple.com/forums/thread/795348 I rambled too much and did not understand the underlaying problem. The problem is that I have a C function in a iOS library. I want to call this C function from a dylib that this library loads on runtime. When running directly from Xcode (either in debug or release mode) this works correctly. However, when the app is uploaded to testflight or distributed for debugging then the function is stripped and a null function pointer exception crashes the app. In the last post it was really hard to explain and I was pressed on time but I've created a minimal reproducible example: https://github.com/ospfranco/dylib_crash The instructions to run and reproduce the crash are on the README.
Replies
2
Boosts
0
Views
648
Activity
Jan ’26
Xcode Organizer is blowing up
An error occurred preventing Xcode from downloading version information from App Store Connect for account "xxxxxxxx". An unexpected error occurred: [<__NSDictionaryM 0x600003ed4fe0> valueForUndefinedKey:]: this class is not key value coding-compliant for the <app name! 5.00.12 (iOS App). I have no idea what the hell is causing this. I have checked all of the links between screens and objects and none are missing. This is a live active version on the store.
Replies
0
Boosts
0
Views
183
Activity
Nov ’25
Basic c++xcodeproj call to swift code
I have c++ macOs app(Xcode +14) and I try to add call to swift code. I can't find any simple c++ xcodeproj call to swift code. I create new simple project and fail to build it with error when I try to include #include <SwiftMixTester/SwiftMixTester-Swift.h>: main.m:9:10: error: 'SwiftMixTester/SwiftMixTester-Swift.h' file not found (in target 'CppCallSwift' from project 'CppCallSwift') note: Did not find header 'SwiftMixTester-Swift.h' in framework 'SwiftMixTester' (loaded from '/Users/yanivsmacm4/Library/Developer/Xcode/DerivedData/CppCallSwift-exdxjvwdcczqntbkksebulvfdolq/Build/Products/Debug') . Please help.
Replies
5
Boosts
0
Views
810
Activity
Oct ’25