Newbie: vala app builds & runs fine but lots of C errors are output 0.56 vs 0.48

I have a small single file vala test app ~100 lines. It compiles & runs fine but during compilation I get lots of errors. I’m on Ubuntu 22.04:

$ valac --version
Vala 0.56.0
$ valac -o wordladder --pkg gee-0.8 --pkg gio-2.0 wordladder.vala
In file included from /usr/include/glib-2.0/glib/gthread.h:32,
                 from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /home/mark/app/vala/wordladder/wordladder.vala.c:9:
/home/mark/app/vala/wordladder/wordladder.vala.c: In function ‘word_set_get_type’:
/usr/include/glib-2.0/glib/gatomic.h:113:5: warning: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types]
  113 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
/home/mark/app/vala/wordladder/wordladder.vala.c:160:13: note: in expansion of macro ‘g_once_init_enter’
  160 |         if (g_once_init_enter (&word_set_type_id__once)) {
      |             ^~~~~~~~~~~~~~~~~
/home/mark/app/vala/wordladder/wordladder.vala.c: In function ‘word_list_get_type’:
/usr/include/glib-2.0/glib/gatomic.h:113:5: warning: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types]
  113 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
/home/mark/app/vala/wordladder/wordladder.vala.c:208:13: note: in expansion of macro ‘g_once_init_enter’
  208 |         if (g_once_init_enter (&word_list_type_id__once)) {
      |             ^~~~~~~~~~~~~~~~~
/home/mark/app/vala/wordladder/wordladder.vala.c: In function ‘_thread_safe_regex_init’:
/usr/include/glib-2.0/glib/gatomic.h:113:5: warning: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types]
  113 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
/home/mark/app/vala/wordladder/wordladder.vala.c:333:13: note: in expansion of macro ‘g_once_init_enter’
  333 |         if (g_once_init_enter ((volatile gsize*) re)) {
      |             ^~~~~~~~~~~~~~~~~

When I build using Vala 0.48.17 on Debian 11, there are no error messages at all.
So am I right to assume these errors are nothing to worry about?
Oh, if you want to see the source it is on github.

Yes. These warnings are normal and nothing to worry about. Although usually they are turned off, so you don’t get them, like you saw in Debian 11. I would say you should open an issue on the ubuntu package.

The code generated by Vala should drop the “volatile” modifier, if that’s not the case already.

OK, thanks!
(this is to make up the 20 char min.)

In addition, your project’s build system should silence C compiler warnings using -w (unless you happen to be working on making valac output code that produces fewer warnings). Hoping that valac will generate C code that doesn’t emit warnings is not realistic, and you want clean output so that you can focus on Vala warnings instead.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.