diff options
| author | Emmanuele Bassi <ebassi@gnome.org> | 2019-09-04 19:39:25 +0100 |
|---|---|---|
| committer | Christoph Reiter <reiter.christoph@gmail.com> | 2019-09-15 17:12:45 +0000 |
| commit | 073dcd088215c4eaafe90a256e398b83327888e6 (patch) | |
| tree | 53117303d734ff3651243e043b2fc8c67f763f71 /tests/scanner/Regress-1.0-Gjs-expected | |
| parent | d08b5019099a6375563ede434d29038e6916256e (diff) | |
| download | gobject-introspection-073dcd088215c4eaafe90a256e398b83327888e6.tar.gz | |
Support array arguments with static keyword
C99 allows defining an array argument with a fixed size as:
void foo (int arr[static 10])
Compilers conforming to the C99 specification will be able to warn if
the function is called with NULL or with an array smaller than the
specified length, something that does not happen when using pre-C99
declarations like:
void foo (int arr[10])
As the declaration above is identical to:
void foo (int arr[])
Which is, in turn, identical to:
void foo (int *arr)
Fixes: #309
Diffstat (limited to 'tests/scanner/Regress-1.0-Gjs-expected')
| -rw-r--r-- | tests/scanner/Regress-1.0-Gjs-expected/Regress.test_array_static_in_int.page | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.test_array_static_in_int.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.test_array_static_in_int.page new file mode 100644 index 00000000..2cd3b478 --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.test_array_static_in_int.page @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<page id="Regress.test_array_static_in_int" + type="topic" + style="function" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + <link xref="index" group="function" type="guide"/> + <api:function> + <api:returns> + <api:type>void</api:type> + </api:returns> + <api:name>regress_test_array_static_in_int</api:name> + <api:arg> + <api:type>Array(Number(gint))</api:type> + <api:name>x</api:name> + </api:arg> + </api:function> + </info> + <title>Regress.test_array_static_in_int</title> + <synopsis><code mime="text/x-gjs"> +function test_array_static_in_int(x: Array(Number(gint))): void { + // Gjs wrapper for regress_test_array_static_in_int() +} + </code></synopsis> + + +<terms> +<item> +<title><code>x</code></title> + <p>a list of 10 integers</p> +</item> +</terms> + +</page> |
