Introduce Q_ATTRIBUTE_FORMAT_PRINTF

Removes a lot of copy-paste code for flagging printf style functions.

Change-Id: Iecc1e312d1f28b5cbb6b297039f1cdbbc888f843
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix qlocale_blackberry buffer initialization

The QVarLengthArray inside qlocale_blackberry.cpp was being preallocated with
512 bytes, that means internally it could grow up to 512 bytes using the
stack before switching to the heap, but its actual semantic size was still 0.
After qt_safe_read(... buffer.data() ...) was being called, data was written
to the QVarLengthArray buffer, but its semantic size was still 0, since it was
not resized or anything. This triggered an assertion when buffer[bytes] = '\0'
was assigned, since 'bytes' > buffer.size() ( == 0) despite buffer.capacity()
== 512.

Change-Id: I5503ee9b02413794f67730700fba05a4c194d465
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>