This is a work in progress. Ultimately, we want to run the test suite
with an `-fsanitize=bounds` build on weekly schedule.
Currently, however, any build with `-fsanitize=something` fails in CI
because `libubsan` is not installed in the CI image. That needs to be
fixed and the CI image updated before we can use it in CI. I won’t do
that now, though, as this branch can only land once next cycle opens,
and that would probably result in rebuilding the CI images twice if I do
it now.
We may want to consider using clang for the sanitiser builds, too,
partially to test building with clang, and partially because its
sanitiser support is typically a little more progressed than gcc’s.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
These arrays were declared using the pre-C99 gcc extension which treated
any trailing array in a struct as potentially flexible in length.
Change them to be C99 flexible arrays, annotate them with
`G_COUNTED_BY`, and adjust the size calculations of the overall structs
to match. The size of the overall struct will have decreased as `sizeof
(struct->my_flexible_array)` is `sizeof (*struct->my_flexible_array)` if
`my_flexible_array[1]` is used in the definition, whereas it’s zero if
C99 `my_flexible_array[]` syntax is used.
See https://people.kernel.org/kees/bounded-flexible-arrays-in-c#replace-1-element-arrays
I found the declarations using:
```sh
git grep '\[1\];' | grep -v '='
```
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Using the new `G_COUNTED_BY` macro (i.e. the `__counted_by__`
attribute).
I found the declarations using:
```sh
git grep '\[\];' | grep -v '='
```
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
If we don't do this, the --help text is formatted as though the option
did not expect an argument.
IDENTIFIER is a new translated string, but it is developer-oriented,
so a missing translation is not particularly bad. COMMAND is already
present in translations.
Signed-off-by: Simon McVittie <smcv@collabora.com>
If we don't do this, the --help text is formatted as though the option
did not expect an argument.
This introduces a new translated string, but it is developer-oriented,
so a missing translation is not particularly bad.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Otherwise, correct invocation isn't clear from the --help output.
This does not introduce new translated strings: FILE was already
translated.
Signed-off-by: Simon McVittie <smcv@collabora.com>
If we don't do this, the --help text is formatted as though the option
did not expect an argument.
This does not introduce new translated strings: DIRECTORY was already
translated.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Partially because the use of `G_GSIZE_MODIFIER` breaks translatable
string extraction (issue #3271) and partially because `g_format_size()`
produces more human-readable results anyway.
Prior to commit cf5e371c67 the code was using `%lu`, so this is a fairly
new issue.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: #3271
The ref held by `data->task` may be the last one on the `GTask`. The
`GTask` stores `attempt->data` as its task data, and so when the `GTask`
is finalised, `attempt->data` is too. `connection_attempt_remove()`
needs to access `attempt->data`, so must be called before the
`g_object_unref()` in this situation.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: #3266
The code and strings are the same, so let’s simplify things and reduce
LoC for no functional change.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This fixes a few formatting and newline issues in the strings at the
same time, but nothing major.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: #3263
PCRE2 10.43 has now introduced support for variable-length lookbehind,
so these tests now fail if GLib is built against PCRE2 10.43 or higher.
See
e8db6fa713/ChangeLog (L94).
Rather than making the tests conditional on the version of PCRE2 in use,
just remove them. They are mostly testing the PCRE2 code rather than
any code in GLib, so don’t have much value.
This should fix CI runs on msys2-mingw32, which updated to PCRE2 10.43 2
days ago.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Currently, the `stop_func` is executed on an extra thread, and the
`g_context_specific_group_remove` function returns before the `stop_func`
finishes. It may happen that the `stop_func` is never executed if the
program terminates soon after calling it. Let's wait until the `stop_func`
is done.
Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/3258