2005-03-08 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Define G_GNUC_NULL_TERMINATED.
(#164706, Marc Meissner)
* glib/gstrfuncs.h:
* glib/gfileutils.h: Use G_GNUC_NULL_TERMINATED where
appropriate.
12 files changed:
2005-03-08 Matthias Clasen <mclasen@redhat.com>
2005-03-08 Matthias Clasen <mclasen@redhat.com>
+ * glib/gmacros.h: Define G_GNUC_NULL_TERMINATED.
+ (#164706, Marc Meissner)
+
+ * glib/gstrfuncs.h:
+ * glib/gfileutils.h: Use G_GNUC_NULL_TERMINATED where
+ appropriate.
+
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
2005-03-08 Matthias Clasen <mclasen@redhat.com>
2005-03-08 Matthias Clasen <mclasen@redhat.com>
+ * glib/gmacros.h: Define G_GNUC_NULL_TERMINATED.
+ (#164706, Marc Meissner)
+
+ * glib/gstrfuncs.h:
+ * glib/gfileutils.h: Use G_GNUC_NULL_TERMINATED where
+ appropriate.
+
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
2005-03-08 Matthias Clasen <mclasen@redhat.com>
2005-03-08 Matthias Clasen <mclasen@redhat.com>
+ * glib/gmacros.h: Define G_GNUC_NULL_TERMINATED.
+ (#164706, Marc Meissner)
+
+ * glib/gstrfuncs.h:
+ * glib/gfileutils.h: Use G_GNUC_NULL_TERMINATED where
+ appropriate.
+
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
2005-03-08 Matthias Clasen <mclasen@redhat.com>
2005-03-08 Matthias Clasen <mclasen@redhat.com>
+ * glib/gmacros.h: Define G_GNUC_NULL_TERMINATED.
+ (#164706, Marc Meissner)
+
+ * glib/gstrfuncs.h:
+ * glib/gfileutils.h: Use G_GNUC_NULL_TERMINATED where
+ appropriate.
+
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
* glib/goption.c (parse_int): Fix an error message.
(#168751, Hazael Maldonado Torres)
+2005-03-08 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/glib-sections.txt:
+ * glib/tmpl/macros_misc.sgml: Document G_GNUC_NULL_TERMINATED.
+
2005-03-07 Matthias Clasen <mclasen@redhat.com>
* gobject/tmpl/gtype.sgml:
2005-03-07 Matthias Clasen <mclasen@redhat.com>
* gobject/tmpl/gtype.sgml:
G_GNUC_PRINTF
G_GNUC_SCANF
G_GNUC_FORMAT
G_GNUC_PRINTF
G_GNUC_SCANF
G_GNUC_FORMAT
G_GNUC_FUNCTION
G_GNUC_PRETTY_FUNCTION
G_GNUC_NO_INSTRUMENT
G_GNUC_FUNCTION
G_GNUC_PRETTY_FUNCTION
G_GNUC_NO_INSTRUMENT
@arg_idx: the index of the argument.
@arg_idx: the index of the argument.
+<!-- ##### MACRO G_GNUC_NULL_TERMINATED ##### -->
+<para>
+Expands to the GNU C <literal>sentinel</literal> function attribute if the
+compiler is <command>gcc</command>, or "" if it isn't. This function attribute
+only applies to variadic functions and instructs the compiler to check that
+the argument list is terminated with an explicit %NULL.
+See the GNU C documentation for details.
+</para>
+
+Since: 2.8
+
<!-- ##### MACRO G_GNUC_FUNCTION ##### -->
<para>
Expands to the GNU C <literal>__FUNCTION__</literal> variable if the
<!-- ##### MACRO G_GNUC_FUNCTION ##### -->
<para>
Expands to the GNU C <literal>__FUNCTION__</literal> variable if the
gchar *g_build_path (const gchar *separator,
const gchar *first_element,
gchar *g_build_path (const gchar *separator,
const gchar *first_element,
+ ...) G_GNUC_NULL_TERMINATED;
gchar *g_build_filename (const gchar *first_element,
gchar *g_build_filename (const gchar *first_element,
+ ...) G_GNUC_NULL_TERMINATED;
#define G_GNUC_MALLOC
#endif
#define G_GNUC_MALLOC
#endif
+#if __GNUC__ >= 4
+#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
+#else
+#define G_GNUC_NULL_TERMINATED
+#endif
+
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
gchar* g_strnfill (gsize length,
gchar fill_char) G_GNUC_MALLOC;
gchar* g_strconcat (const gchar *string1,
gchar* g_strnfill (gsize length,
gchar fill_char) G_GNUC_MALLOC;
gchar* g_strconcat (const gchar *string1,
- ...) G_GNUC_MALLOC; /* NULL terminated */
+ ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
gchar* g_strjoin (const gchar *separator,
gchar* g_strjoin (const gchar *separator,
- ...) G_GNUC_MALLOC; /* NULL terminated */
+ ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
+
/* Make a copy of a string interpreting C string -style escape
* sequences. Inverse of g_strescape. The recognized sequences are \b
* \f \n \r \t \\ \" and the octal format.
/* Make a copy of a string interpreting C string -style escape
* sequences. Inverse of g_strescape. The recognized sequences are \b
* \f \n \r \t \\ \" and the octal format.
2005-03-08 Matthias Clasen <mclasen@redhat.com>
2005-03-08 Matthias Clasen <mclasen@redhat.com>
+ * gobject.h: Use G_GNUC_NULL_TERMINATED where
+ appropriate. (#164706, Marc Meissner)
+
* gvaluearray.h: Small cleanup (use G_BEGIN/END_DECLS).
(#168474, Fabricio Barros Cabral)
* gvaluearray.h: Small cleanup (use G_BEGIN/END_DECLS).
(#168474, Fabricio Barros Cabral)
gpointer g_object_new (GType object_type,
const gchar *first_property_name,
gpointer g_object_new (GType object_type,
const gchar *first_property_name,
+ ...) G_GNUC_NULL_TERMINATED;
gpointer g_object_newv (GType object_type,
guint n_parameters,
GParameter *parameters);
gpointer g_object_newv (GType object_type,
guint n_parameters,
GParameter *parameters);
va_list var_args);
void g_object_set (gpointer object,
const gchar *first_property_name,
va_list var_args);
void g_object_set (gpointer object,
const gchar *first_property_name,
+ ...) G_GNUC_NULL_TERMINATED;
void g_object_get (gpointer object,
const gchar *first_property_name,
void g_object_get (gpointer object,
const gchar *first_property_name,
+ ...) G_GNUC_NULL_TERMINATED;
gpointer g_object_connect (gpointer object,
const gchar *signal_spec,
gpointer g_object_connect (gpointer object,
const gchar *signal_spec,
+ ...) G_GNUC_NULL_TERMINATED;
void g_object_disconnect (gpointer object,
const gchar *signal_spec,
void g_object_disconnect (gpointer object,
const gchar *signal_spec,
+ ...) G_GNUC_NULL_TERMINATED;
void g_object_set_valist (GObject *object,
const gchar *first_property_name,
va_list var_args);
void g_object_set_valist (GObject *object,
const gchar *first_property_name,
va_list var_args);