Xcode 4.6 3

Xcode 4.6 Recommended Build Settings

Dear all, I’m building WRF against PGI compilers and I’ve never had problems. I upgraded both Xcode (from 4.5.2) and the PGI suite (from 13.9) and this is what’s happening: gcc -I.I/MELgrib1 -DMACOS -DDMPARALLEL -DMAXHISTORY=25 -c alloc2d.c PGC-S-0040-Illegal use of symbol, BEGINDECLS (/usr/include/stdio.h: 164) PGC-S-0035-Syntax error: Recovery attempted by replacing. Get a customized roadmap for your app and start building it in 7 days:⚡ 4 Tutorial For Beginners is a series to tea. Then simply click on the “+” button to expand the information about the release and to access the download, it will be labeled something like “Xcode 7.3.1.dmg” or “Xcode 10.xip” according to the version you are downloading. In Xcode 3.1 up to Xcode 4.6.3, it included the LLVM-GCC compiler, with front ends from the GNU Compiler Collection and a code generator based on LLVM. In Xcode 3.2 and later, it included the Clang C/C/Objective-C compiler, with newly-written front ends and a code generator based on LLVM, and the Clang static analyzer. I think version 4.6.3 is the latest compatible with Lion. – JWWalker Dec 15 '14 at 16:19 as i see in the dev page. 4.3.3 is the latest ver of xcode for Mac OS X Lion 10.7 – Mohamed Shibo Dec 15 '14 at 16:26.

Xcode 4.6 introduced a number of additional compiler warnings that are enabled by default for new projects. Unfortunately the release notes are none too clear about the new options:

4.6

LLVM: New compiler warnings to help find subtle behavioral bugs when using automatic release counting (ARC) and weak references.

If you have an existing project you can update to the new recommended build settings from the project page using the “Validate Settings” button:

A diff with the Xcode project.pbxproj file checked into source control reveals the changed settings:

If you check the build settings for the project you will find three of the new settings in the Apple LLVM compiler 4.2 - Warnings - All languages section:

The remaining setting is in the Apple LLVM compiler 4.2 - Warnings - Objective C section:

A useful tip here to get a detailed description for a build setting is to have the quick help window open in the utilities sidebar when clicking on each setting.

New Project Build Settings

For the purposes of this post I have been using one of the example projects (WorldFacts) from my GitHub CodeExamples repository which was created back in June 2012. From the date I would guess that means I was probably using Xcode 4.3.3. Out of curiosity I compared the build settings after updating this project with a clean new project created with Xcode 4.6. There seems to be one additional compiler warning that is enabled by default for the new Xcode 4.6 project that the validate settings option does not enable for existing projects:

Empty Loop Bodies: Warn about loop bodies that are suspiciously empty. [CLANG_WARN_EMPTY_BODY, -Wempty-body]

It is possible this was already a default for new projects prior to Xcode 4.6 and I have never noticed. It does seem strange though that the validate settings option does not update it for existing projects. Anyway since I would probably like to know about suspiciously empty loop bodies I have also enabled it for the existing project.

What follows is a more detailed description of each of the four new Xcode 4.6 compiler warning build settings. In each case I have included the detailed description from the help documentation for reference.

Implicit Constant Conversions

Warn about implicit conversions of constant values that cause the constant value to change, either through a loss of precision, or entirely in its meaning. [CLANG_WARN_CONSTANT_CONVERSION, -Wconstant-conversion]

This catches problems such as the following where a constant is converted to a type that causes the value to change:

Implicit Enum Conversions

Warn about implicit conversions between different kinds of enum values. For example, this can catch issues when using the wrong enum flag as an argument to a function or method. [CLANG_WARN_ENUM_CONVERSION, -Wenum-conversion]

For an example, suppose I have two somewhat similar enum types defined for a class:

A method that is expecting a UYLMagicValue as an argument:

Most of the time Xcode autocompletion will guide you to the right value when calling this method but it is still easy to end up with the following by mistake:

Assuming that I had actually intended to pass UYLMagicAdmin this is going to end in disappointment. With the new compiler warning enabled you get the following:

Incompatible Integer to Pointer Conversion

Warn about implicit conversions between pointers and integers. For example, this can catch issues when one incorrectly intermixes using NSNumber’s and raw integers. [CLANG_WARN_INT_CONVERSION, -Wint-conversion]

This warning works either way when there is an implicit conversion between integers and pointers:

Duplicate Method Definitions

Warn about declaring the same method more than once within the same @interface.

This is a pretty simple one that picks up multiple definitions of the same method in an interface definition:

One last thing

If you are still using the LLVM-GCC compiler or GDB debugger you should also note the following warning in the Xcode 4.6 release notes and start thinking about adopting LLVM/LLDB in the near future:

DEPRECATED: LLVM-GCC compiler and GDB debugger.Xcode 4.6 is the last release to include the LLVM-GCC compiler and the GDB debugger.

Use the LLVM compiler and the LLDB debugger, and file reports at https://bugreport.apple.com for issues that require the use of LLVM-GCC or GDB.

So, you’ve installed Xcode 4.6, and you are a C++ programmer.

You want to use the latest and greatest, so you create a new project, and add your sources to the project, and hit Build, and … guess what? Your code doesn’t build!

What’s up with that?

In Xcode 4.6 (and presumably, later versions), the default C++ compiler is clang, the default language is C++11, and the standard library is libc++.

This is a change from previous versions, where the default was gcc 4.2.1, C++03, and libstdc++.

This is good news

Clang is a much more capable compiler than gcc 4.2.1. It’s also better integrated into Xcode.

Xcode 4.6.3 Dmg Torrent

C++11 is a major upgrade in functionality from C++03. There have been lots of articles written about the new features, so I won’t belabor them here.

However, with a new language, compiler, and standard library, there are some incompatibilities. I’ll try to run through the common ones, and hopefully you will be up and running quickly.

How can I tell if I’m using libc++?

If you’re writing cross-platform code, sometimes you need to know what standard library you are using. In theory, they should all offer equivalent functionality, but that’s just theory. Sometimes you just need to know. The best way to check for libc++ is to look for the preprocessor symbol _LIBCPP_VERSION. If that’s defined, then you’re using libc++.

Note that this symbol is only defined after you include any of the libc++ header files. If you need a small header file to include just for this, you can do:

The header file “ciso646” is required by both the C++03 and C++11 standards, and defined to do nothing.

What happened to TR1?

Technical Report #1 (TR1) was a set of library additions to the C++03 standard. Representing the fact that they were not part of the “official” standard, they were placed in the namespace std::tr1.

Xcode 4.6 3 Dmg Download

In c++11, they are officially part of the standard, and live in the namespace std, just like vector and string. The include files no longer live in the “tr1” folder, either.

So, code like this:

Xcode 4.6 3 Free Download For Mac

Needs to be changed to:

It’s probably easiest to just search your code base for references to tr1 and remove them.

Missing identifiers (include what you use)

“My code used to build with Xcode 4.5, and now I’m getting “unknown identifier” errors with stuff in the standard C (or C++) library!”

Library headers may include other library headers. Sometimes, this is required by the standard, sometimes it is done as an “implementation feature” of the library.

To be portable, you should explicitly include the header files that define the routines that you use. That way, you’re not dependent on the internal details of libc++ (or libstdc++).

For example, if you are calling std::malloc (or malloc), you should really #include <cstdlib> (or #include <stdlib.h>) to make sure that it is defined.

[ Updated 03-03 ] In a Xcode-Users mailing list posting, Todd Heberlein writes:

This is almost certainly because his library was built with gcc/stdlibc++, and his new tool with clang/libc++.

More to come.

As I find other differences, I will be adding to this document. If you come across things, please let me know in the comments and I will add them.