GNOME Bugzilla – Bug 794210
Solve the "empty file problem"
Last modified: 2018-05-22 16:01:40 UTC
The "empty file problem" is an indication of Vala's current dependence on GLib, even when there is no code in the Vala source file. It currently has three things that need solving: 1. An empty Vala files compiled to C will have includes for glib.h and glib-object.h. The C file should be empty 2. There is currently nothing in the test infrastructure to check C output from valac. A test should be implemented to check that an empty source file produces an empty C file 3. Compiling an empty Vala source file with --nostdpkg produces an error "The namespace name `GLib' could not be found". It should produce an empty C file At present an empty Vala files produces something like: /* empty_vala_source.c generated by valac 0.39.92.14-46f76-dirty, the Vala compiler * generated from empty_vala_source.vala, do not modify */ #include <glib.h> #include <glib-object.h> The includes don't need to be there. There is currently no option to not have the comment at the beginning, but that is probably fine. Any test mechanism would need to take account of the comment.
I agree that compiling an empty vala source file should be handled properly. Although it should not result in an empty C file, but containing the mentioned commented generation header.
-- 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/623.