summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-11-11 21:47:13 -0500
committerRyan Lortie <desrt@desrt.ca>2010-11-11 21:49:21 -0500
commit48ca3add143896fa5664860a94947907cfe5daa2 (patch)
treeace4467d4aa7ed922f171e3c911c10e8e56e61fb /docs
parent6bc20651ecf8e8b5d9ffea89ae76083ededa3c0b (diff)
G_STATIC_ASSERT: clarify when use is valid
Clarify when the use of G_STATIC_ASSERT is valid and fix up an invalid use of it in GDBus.
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/glib/tmpl/macros_misc.sgml6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml
index 387a8a549..eb875bb17 100644
--- a/docs/reference/glib/tmpl/macros_misc.sgml
+++ b/docs/reference/glib/tmpl/macros_misc.sgml
@@ -153,6 +153,12 @@ GdkColor *favourite = traveller_get_favourite_colour (traveller);
The G_STATIC_ASSERT macro lets the programmer check a condition at compile time,
the condition needs to be compile time computable.
The macro can be used in any place where a <literal>typedef</literal> is valid.
+</para>
+<note><para>
+A <literal>typedef</literal> is generally allowed in exactly the same
+places that a variable declaration is allowed. For this reason, you should not use <literal>G_STATIC_ASSERT</literal> in the middle of blocks of code.
+</para></note>
+<para>
The macro should only be used once per source code line.
</para>