GNOME Bugzilla – Bug 622338
strange errors when using volatile fields
Last modified: 2018-05-22 13:39:11 UTC
With vala fresh from git: public class test { private volatile int i; static int main(string[] args) { test t = new test(); t.i = 0; int j = t.i + 1; return j; } } test.vala:2.22-2.22: error: syntax error, expected `;' private volatile int i; ^ Compilation failed: 1 error(s), 0 warning(s)
Created attachment 186107 [details] [review] 0001-Add-volatile-to-GType-profile.patch
Created attachment 186381 [details] [review] 0002-Add-volatile-to-GType-profile.patch Patch rebased against attachment 186380 [details] [review]
After talk with Jürg on Desktop Summit: he found much cleaner implementation of atomics. I'm lefting this bug opened as the error is still present.
(In reply to comment #3) > After talk with Jürg on Desktop Summit: he found much cleaner implementation of > atomics. I'm lefting this bug opened as the error is still present. Volatile is not only about atomic.
(In reply to comment #4) > (In reply to comment #3) > > After talk with Jürg on Desktop Summit: he found much cleaner implementation of > > atomics. I'm lefting this bug opened as the error is still present. > > Volatile is not only about atomic. No, it is not but the main argument for introducing the volatile in Vala was to have proper atomic support (using glib functions/macros). Other uses while useful are rather not in area Vala is targeting (like drivers etc.). If you can think about useful case of volatile in Vala (by useful I mean justifing extending language itself rather then using other language or other language + C) please fell free to mention it here. During our discussion only a kernel in Vala from a few years back appeared.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/110.