[glib] gstrfuncs: Add a string formatting note about using G_GUINT64_FORMAT



commit 5ee333e4cb0b3d2160fcde7c6b3287fe2a8f079e
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Wed Mar 4 11:37:40 2015 +0000

    gstrfuncs: Add a string formatting note about using G_GUINT64_FORMAT
    
    …and friends. The ‘String precision pitfalls’ section is already linked
    to from all the relevant printf()-style functions, so this documentation
    should hopefully be easy to find.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741779

 glib/gstrfuncs.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
index 9498d81..6c079bf 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
@@ -84,6 +84,13 @@
  * certain number of columns, then \%Ns is not a correct solution
  * anyway, since it fails to take wide characters (see g_unichar_iswide())
  * into account.
+ *
+ * Note also that there are various printf() parameters which are platform
+ * dependent. GLib provides platform independent macros for these parameters
+ * which should be used instead. A common example is %G_GUINT64_FORMAT, which
+ * should be used instead of `%llu` or similar parameters for formatting
+ * 64-bit integers. These macros are all named `G_*_FORMAT`; see
+ * [Basic Types][glib-Basic-Types].
  */
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]