Android NDK Revision 10d available

For all the people that develop for Android, a new version( revision 10d) of the Android Native Development Kit has been released.

Android NDK Revision 10d available

From the release log:

  • Made GCC 4.8 the default for all 32-bit ABIs. Deprecated GCC 4.6, and will remove it next release. To restore previous behavior, either add NDK_TOOLCHAIN_VERSION=4.6 to ndk-build, or add --toolchain=arm-linux-androideabi-4.6 when executing make-standalone-toolchain.sh on the command line. GCC 4.9 remains the default for 64-bit ABIs.
  • Stopped all x86[_64] toolchains from adding -mstackrealign by default. The NDK toolchain assumes a 16-byte stack alignment. The tools and options used by default enforce this rule. A user writing assembly code must make sure to preserve stack alignment, and ensure that other compilers also comply with this rule. (GCC bug 38496)
  • Added Address Sanitizer functionality to Clang 3.5 support to the ARM and x86 ABIs. For more information on this change, see the Address Sanitizer project.
  • Introduced the requirement, starting from API level 21, to use -fPIE -pie when building. In API levels 16 and higher, ndk-build uses PIE when building. This change has a number of implications, which are discussed in Developer Preview Issue 888. These implications do not apply to shared libraries.

And much more ...

In defense of printf -- Kenny Kerr

To use or not to use cout instead of printf -- that is the question!

In case you missed Kenny Kerr's article on printf vs cout:

In defense of printf

From the article:

Folks seem to enjoy pointing out that I use printf in many of my examples of “modern C++”, as if printf is not really proper C++. Apparently, I should be using cout. The trouble is that cout isn’t exactly modern either...

 

Address and Thread Sanitizers in GCC -- Red Hat Developer Blog

A short article about two error-detection features in GCC:

Address and Thread Sanitizers in GCC

by Dodji Seketeli on Red Hat Developer Blog

From the article:

Since their 4.8 version, the C and C++ compilers of the GNU Compiler Collection are equipped with built-in memory and data race errors detectors named Address Sanitizer and Thread Sanitizer.

This article intends to quickly walk you through the highlights of these two interesting tools.

Quick Q: What is noexcept useful for? -- StackOverflow

Quick A: Guaranteeing "this function won't throw" enables optimization opportunities.

Recently on SO:

What is noexcept useful for?

I saw that c++11 added the noexcept keyword. But I don't really understand why is it useful.

If the function throws when it's not supposed to throw - why would I want the program to crash?

So when should I use it?

Also, how will it work along with compiling with /Eha and using _set_se_translator? This means that any line of code can throw c++ exception - because it might throw a SEH exception (Because of accessing protected memory) and it will be translated to c++ exception.

What will happen then?

A gotcha with ptr_vector -- Andrzej KrzemieĊ„ski

Do you know Boost.Pointer Container? Andrzej gives some useful information in his recent blog entry:

A gotcha with ptr_vector

He gives answers to these questions:

What would you use boost::ptr_vector for? Why would you need to have a vector of pointers, which you want to delete yourself? Is it because:

  1. You want the objects to remain at the same address even if you re-allocate the array under the vector?
  2. You want to inter-operate with a library that already deals with owing pointers?
  3. You want it to be faster than if you were storing values in std::vector?
  4. You want the “polymorphic behavior” of your objects?

New Security Feature in Visual Studio 2015

An article about a security feature in Visual Studio 2015, called Control Flow Guard.

Visual Studio 2015 Preview: Work-in-Progress Security Feature

by Jim Hogg

From the article:

By simply adding a new option to your Project, the Visual C++ compiler will inject extra security checks into your binaries. These will detect attempts to hijack your code. The check will stop execution of your code, before the hijacker can do damage to your data or PC...

Property Testing in C++ -- Jeremy Wright

In case you missed it, this may be midly controversial but we felt it could be of interest:

Property Testing in C++

by Jeremy Wright

From the article:

One might say tests are shiny. I don't know if they are really shiny as much as I found another cool use for uniform_int_distribution<>...

Qt 5.4 released --Lars Knoll

A new major version of the Qt has been released.

Qt 5.4 released

From the news article:

I am happy to announce that Qt 5.4 has been released today and is available for download from qt.io. Together with Qt 5.4, we have also released Qt Creator 3.3 and an update to Qt for device creation on embedded Linux and embedded Android.

But let’s start with Qt 5.4. One of the main focus areas of this Qt release has been around Web technologies and we have a lot of cool new things to offer there...

Tutorial to develop a client side web application in C++ with PNaCl -- Chrome Developer Guide

In case you missed it, now you can develop web apps in C++ to run natively on Google Chrome. This tutorial shows how to develop a Native Client module in C++ and build and run it using PNaCl toolchain:

C++ Tutorial: Getting Started (Part 1)

This tutorial shows how to build and run a web application using Portable Native Client (PNaCl). This is a client-side application that uses HTML, JavaScript and a Native Client module written in C++. The PNaCl toolchain is used to enable running the Native Client module directly from a web page...

Portable Native Client or PNacl, which is supported on Google Chrome at the moment, lets you compile and run native code developed in C or C++ within a secure sandbox in browser. PNaCl uses the LLVM toolchain to generate OS-independent and architecture agnostic intermediate bytecode which is later loaded, translated and executed by the browser. To get more information on PNaCl and it's less portable companion NaCl check the native client developer documentation.