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

48 Posts

Post

Replies

Boosts

Views

Activity

Meaning of "Page In" in xCode Instruments
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results. I did the test to open a file in 1KB size. The analysis results from xCode Instruments is as followings: In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached) In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png & P3.png attached) That is, Size of "File Backed Page In" is around 4*16K=64KB. I did similar tests on different size of files. Every time the values of "Disk Usage"->"Page In" and "Virtual Memory Trace"->"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB). I think that both values represent disk IO size of the process and they should be in the same value for the same process. Why the values are different? What are the differences between this two options in xCode Instrument tool? Thanks a lot.
0
1
1.3k
Feb ’22
Erroneous output of a C++ program in MacOS that gives correct output on Windows PC
Hello. I have a M1 Mac mini with MacOS 12.1 (MacOS Monterey). I have written a C++ program in the inbuilt vim text editor for sorting an Array of integers in ascending order using Merge Sort Algorithm. The compiler I am using is the official Clang compiler. MI tried the g++ command as well as clang++ command to compile the program. (Actually both the commands run clang compiler only) The weird thing I am facing is that sometimes it replaces some integers in the output with random integers. I have attached the screenshot. But this behaviour is not observed when I copied the same program in my windows PC. Please help in this regard. I am attaching the C++ program file as well as the screenshot of the output. MergeSort.cpp
3
0
1.7k
Jan ’22
Using reality kit can we can we scan a human and create a 3D model with skeletal structure
Hello, I know that we can capture object using reality kit and create a 3D model of the real world object. Can we also use reality kit to scan a human and create a 3D model of the human along with the skeletal structure. So we can use the same scanned human in the motion capture and display the motion animation with the real person. Thanks & Regards, Rakesh
0
0
859
Jan ’22
How to view the image(cv::mat) in the debug mode in xcode
Recently, I am learning some knowledge about OpenCV on Mac, refer to the online tutorial to configure OpenCV of C++ on Xcode, and implement some simple examples on Xcode. The biggest problem encountered is how to preview the image in debug mode. The cv::Mat image cannot be previewed directly, which is very unfriendly for debugging. I also found some solutions to this problem on the Internet, and these results are disappointing, at least for me as a programming beginner. I hope that this function implemented by xcode has the corresponding "OpenCV Image Viewer" plug-in on other IDEs on Mac such as Pycharm and CLion, and the "Image Watch" plug-in corresponding to Visual Studio on Windows. For me, this feature is necessary. According to this idea, is it a wrong choice to learn OpenCV C++ with Xcode, and embracing CLion on a Mac is the best choice for me? (Considering that Xcode is an IDE for Swift, I don't know much about Swift.) The process of implementing these simple examples on Xcode is still very enjoyable. I like Xcode's UI design. Therefore, I still hope that there is the best way to solve this problem in Xcode. The following is an example of running C++ OpenCV on Xcode: Xcode Version: 13.2.1 (13C100) OpenCV Version: stable 4.5.3 (bottled)
0
0
1.9k
Jan ’22
iOS 15 app ui keep breaking after few hour kept in background
Hello everyone. I have an issue with an iOS react-native app after the iOS 15 upgrade but with not a crash. If someone opens the app after ~1 hour from the last time he/she opened it, the app skips the SplashScreen, and after that nothing renders correctly. The positioning and order of components are wrong. also only happens in some devices like iPhone 12 pro max running 15.1.1  any help would be highly appreciated I'm counting on these forms other than that there is no way to debug such an issue or to put any log because even log will not identify issue
1
0
2.8k
Jan ’22
Xcode 13.1 not responding every time after first build macbook Air(2020) M1 Chip
Hello Developers, I am using Xcode(Rosetta Enabled) in macBook Air (2020) with M1 Chip. I am facing an issue with Xcode 13.1 in macOS 12.0.1 whenever I run my project in my device first time it's running successfully but when i do some changes in code and re run the project then it's not responding at all. I need to force quit and re open the xcode do all stuff. I am facing this is issue with my project only..for all other projects Xcode working fine and seamless So I am not understanding what is the issue with my project So If anybody face similar issue please help me Thank you Report
1
0
1.4k
Nov ’21
unknown warning showing up
ld: warning: dylib (/usr/local/Cellar/gcc/11.2.0/lib/gcc/11/libstdc++.dylib) was built for newer macOS version (11.3) than being linked (11.0) this warning is showing up in the terminal every time I run C++ code in it using g++ compiler. how to get rid of it ? I have tried to reinstall Xcode- command line tools but it doesn't seem to solve the problem.
1
0
1.1k
Nov ’21
Meaning of "Page In" in xCode Instruments
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results. I did the test to open a file in 1KB size. The analysis results from xCode Instruments is as followings: In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached) In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png & P3.png attached) That is, Size of "File Backed Page In" is around 4*16K=64KB. I did similar tests on different size of files. Every time the values of "Disk Usage"->"Page In" and "Virtual Memory Trace"->"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB). I think that both values represent disk IO size of the process and they should be in the same value for the same process. Why the values are different? What are the differences between this two options in xCode Instrument tool? Thanks a lot.
Replies
0
Boosts
1
Views
1.3k
Activity
Feb ’22
Erroneous output of a C++ program in MacOS that gives correct output on Windows PC
Hello. I have a M1 Mac mini with MacOS 12.1 (MacOS Monterey). I have written a C++ program in the inbuilt vim text editor for sorting an Array of integers in ascending order using Merge Sort Algorithm. The compiler I am using is the official Clang compiler. MI tried the g++ command as well as clang++ command to compile the program. (Actually both the commands run clang compiler only) The weird thing I am facing is that sometimes it replaces some integers in the output with random integers. I have attached the screenshot. But this behaviour is not observed when I copied the same program in my windows PC. Please help in this regard. I am attaching the C++ program file as well as the screenshot of the output. MergeSort.cpp
Replies
3
Boosts
0
Views
1.7k
Activity
Jan ’22
Using reality kit can we can we scan a human and create a 3D model with skeletal structure
Hello, I know that we can capture object using reality kit and create a 3D model of the real world object. Can we also use reality kit to scan a human and create a 3D model of the human along with the skeletal structure. So we can use the same scanned human in the motion capture and display the motion animation with the real person. Thanks & Regards, Rakesh
Replies
0
Boosts
0
Views
859
Activity
Jan ’22
How to view the image(cv::mat) in the debug mode in xcode
Recently, I am learning some knowledge about OpenCV on Mac, refer to the online tutorial to configure OpenCV of C++ on Xcode, and implement some simple examples on Xcode. The biggest problem encountered is how to preview the image in debug mode. The cv::Mat image cannot be previewed directly, which is very unfriendly for debugging. I also found some solutions to this problem on the Internet, and these results are disappointing, at least for me as a programming beginner. I hope that this function implemented by xcode has the corresponding "OpenCV Image Viewer" plug-in on other IDEs on Mac such as Pycharm and CLion, and the "Image Watch" plug-in corresponding to Visual Studio on Windows. For me, this feature is necessary. According to this idea, is it a wrong choice to learn OpenCV C++ with Xcode, and embracing CLion on a Mac is the best choice for me? (Considering that Xcode is an IDE for Swift, I don't know much about Swift.) The process of implementing these simple examples on Xcode is still very enjoyable. I like Xcode's UI design. Therefore, I still hope that there is the best way to solve this problem in Xcode. The following is an example of running C++ OpenCV on Xcode: Xcode Version: 13.2.1 (13C100) OpenCV Version: stable 4.5.3 (bottled)
Replies
0
Boosts
0
Views
1.9k
Activity
Jan ’22
iOS 15 app ui keep breaking after few hour kept in background
Hello everyone. I have an issue with an iOS react-native app after the iOS 15 upgrade but with not a crash. If someone opens the app after ~1 hour from the last time he/she opened it, the app skips the SplashScreen, and after that nothing renders correctly. The positioning and order of components are wrong. also only happens in some devices like iPhone 12 pro max running 15.1.1  any help would be highly appreciated I'm counting on these forms other than that there is no way to debug such an issue or to put any log because even log will not identify issue
Replies
1
Boosts
0
Views
2.8k
Activity
Jan ’22
Xcode 13.1 not responding every time after first build macbook Air(2020) M1 Chip
Hello Developers, I am using Xcode(Rosetta Enabled) in macBook Air (2020) with M1 Chip. I am facing an issue with Xcode 13.1 in macOS 12.0.1 whenever I run my project in my device first time it's running successfully but when i do some changes in code and re run the project then it's not responding at all. I need to force quit and re open the xcode do all stuff. I am facing this is issue with my project only..for all other projects Xcode working fine and seamless So I am not understanding what is the issue with my project So If anybody face similar issue please help me Thank you Report
Replies
1
Boosts
0
Views
1.4k
Activity
Nov ’21
unknown warning showing up
ld: warning: dylib (/usr/local/Cellar/gcc/11.2.0/lib/gcc/11/libstdc++.dylib) was built for newer macOS version (11.3) than being linked (11.0) this warning is showing up in the terminal every time I run C++ code in it using g++ compiler. how to get rid of it ? I have tried to reinstall Xcode- command line tools but it doesn't seem to solve the problem.
Replies
1
Boosts
0
Views
1.1k
Activity
Nov ’21