Is there a list of pragmas supported in Xcode? - xcode

Is there a list of pragmas supported in Xcode? I only know of #pragma mark. Where would I look to learn about any others?

GCC online manual, see here. Depending on your XCode settings, you can use GCC 4.0, 4.2, 4.4 (if present on your system) or even LLVM/GCC 4.2. Please refer to proper compiler version docs for specific information.

Related

Looking for stdckdint.h in the gcc 11.2 collection

I'm trying to find a copy of stdckdint.h, which I assume should be in the gcc 11.2 collection, but a search fails to locate it in the downloaded source tarball.
Is it not public yet, or do I have to unpack/build something to get the include files?
Gcc11 does not provide stdckdint.h. The documentation of gcc does not mentions it, neither in release notes nor in C standard support page. As the documentation states, C2x support in GCC is incomplete and experimental. The release notes for gcc11 lists implemented C2x features.
In the meantime, you can use my implementation available from https://gitlab.com/Kamcuk/ckd/-/tree/master .

How to use C++14 with Xcode?

I just bought a macbook air,i installed Xcode but its not having c++ 14,i read some threads on stackoverflow and they are mentioning something like clang,what is clang and how do I complete this process??,please explain in layman terms,i am completely new to mac.
Clang/LLVM are Macs' default compiler.
Now, about C++14:
Clang has experimental support for some proposed features of the C++ standard following C++14, provisionally named C++1z. Note that support for these features may change or be removed without notice, as the draft C++1z standard evolves.
You can use Clang in C++1z mode with the -std=c++1z option.
from Clang/LLVM's documentation
So just add "-std=c++1z" to your compile options in Xcode (without the quotes).
I was just now having the same problem. I found this in the build settings:
The drop-down menu has a C++14 option. It solved the problem for me.

C++11 standard library features cross compilers support

I need to verify that some specific standard library feature is implemented and since which version.
For example: std::reference_wrapper
Compilers I need to verify: gcc, clang, msvc
MSVC
I am able to find https://msdn.microsoft.com/en-us/library/bb982605(v=vs.100).aspx so since version 10.0 the reference wrapper is implemented.
clang
On their webpage http://libcxx.llvm.org/ is written that the library is 100% completed. Is it possible to find in which version was what implemented?
gcc
I found: http://en.cppreference.com/w/cpp/compiler_support (language support)
Also: https://gcc.gnu.org/onlinedocs/gcc-4.6.4/libstdc++/manual/manual/status.html#status.iso.200x
- seems reference wrapper is implemented here
But for example 4.8.5 https://gcc.gnu.org/onlinedocs/gcc-4.8.5/libstdc++/manual/manual/status.html#status.iso.2011
There is:
This page describes the C++11 support in mainline GCC SVN, not in any particular release.
I'm confused. Can someone clarify that for me?
http://en.cppreference.com/w/cpp/compiler_support is probably going to be your best shot at finding compiler support versions. From there, you'd need to drill down into standard library release notes for specific implementation versions and details.

no_sanitize not supported in Xcode?

Does anyone know how to disable the address sanitizer for specific functions with the clang version shipped with Xcode 7.x? It seems the function attribute no_sanitize(..) is not supported or do I miss something?
__attribute__((no_sanitize("address")))
I use XCode 7.0.2 (clang-700.1.81) based on LLVM 3.7.0.
http://llvm.org/releases/3.7.0/tools/clang/docs/AttributeReference.html#no-sanitize-clang-no-sanitize
You may be able to use no_sanitize_address instead, which appears to be supported in Apple's current version of clang (as of Xcode 7.2), e.g. the following compiles for me without any warnings:
__attribute__((no_sanitize_address)) void foo(void)
{
}

How does one find what C++11 features have been implemented given a GLIBCXX version

Given a GLIBCXX version of the stdc++ library (example GLIBCXX_3.4.17) given this version, where would one find documentation which specifies what features have been implemented?
Further is there a way to which given the SO NAME version will provide the this same document.
I am working on an embedded system which has an existing version of libstdc++; unfortunately the supplied cross compiler (g++) is at a greater version than what the stdc++ library on the target supports. Upgrading the stdc++ library on the target is not an option. Before I write a lot of code, to only find that it does not run on the target; I would like to know beforehand what is and is not supported.
I have found the GNU Documentation to be useful; however, I am hoping there is a document in which one can get what has been implemented given the symbol version and/or the SO NAME and I just have somehow missed it.
Thanks for any help in advance
given this version, where would one find documentation which specifies what features have been implemented?
You can map a GLIBCXX_A.B.C symbol version to a GCC release by checking
https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
N.B. that won't be precise, because e.g. GCC 5.1 and GCC 5.2 both use GLIBCXX_3.4.21 in the shared library. To tell them apart check the __GLIBCXX__ macro defined by the libstdc++ headers, also documented on that page.
The manuals for libstdc++ releases are at
gcc.gnu.org/onlinedocs/gcc-[X.Y.Z]/libstdc++/manual/
e.g.
https://gcc.gnu.org/onlinedocs/gcc-5.3.0/libstdc++/manual/
Within that manual is a status table showing the implementation status for each standard, the table for C++11 support in GCC 5.3.0 is at
https://gcc.gnu.org/onlinedocs/gcc-5.3.0/libstdc++/manual/manual/status.html#status.iso.2011
Before I write a lot of code, to only find that it does not run on the target; I would like to know beforehand what is and is not supported.
It's not enough to simply avoid using features that aren't supported by the library on the target system. If you link with the cross-compiler then it will depend on the libstdc++.so from that cross-compiler, and will fail to run on the target system if it only has an older libstdc++.so
Upgrading the stdc++ library on the target is not an option.
Then you either need to link statically (creating large executables) or downgrade your cross-compiler to match the target. Or at least force it to use the headers and dynamic library from the same version as found on the target (by overriding the header and library search paths to point to copies of the older files), although that might not work, as the newer g++ might not be able to compile the older headers if they contain some invalid C++ that the older g++ didn't diagnose.

Resources