GNOME Bugzilla – Bug 767522
enchant.vapi has an unneeded cname_prefix attribute
Last modified: 2017-03-09 15:23:14 UTC
Created attachment 329605 [details] Minimal example I recently worked with libenchant from Vala, and using the VAPI file shipped with valac-0.30 on Ubuntu (which I see is the same of the one in master), I get the following warning: $ valac --pkg enchant minimal-enchant.vala enchant.vapi:1.2-1.6: warning: argument `cname_prefix' never used [CCode (cname_prefix = "enchant_", cheader_filename = "enchant.h")] ^^^^^ Compilation succeeded - 1 warning(s) While the compilation works perfectly, this breaks some projects which have --fatal-warnings turned on by default (such as Geary [1], where I recently encountered this problem). Simply removing cname_prefix fixes the issue. I am attaching a minimal example to reproduce the problem. [1]: https://wiki.gnome.org/Apps/Geary
Created attachment 329606 [details] Updated VAPI file Here is an updated VAPI file that does not have the problem (I just removed the cname_prefix="enchant_").
Created attachment 329615 [details] [review] Minor fixes to enchant.vapi Enchant provides a generic API to spelling libraries. See http://www.abisource.com/projects/enchant/ The project is now hosted on GitHub and the header file is here: https://github.com/AbiWord/enchant/blob/master/src/enchant.h The current Vala binding is pretty out of date. Looks like a few deprecated functions and new ones have been added. This patches removes the superfluous cname_prefix, added the get_version() function and fixes the array size type when suggestions are returned. It looks as though the memory handling could be improved in the original binding, but this is a stable binding. Also there are new functions for adding and removing dictionaries and getting and setting Broker parameters. Leonardo Robol if you can review this patch. If you wish to improve the binding further see https://wiki.gnome.org/Projects/Vala/LegacyBindings and submit a git formatted patch. Thanks
commit 29246209a1677a4133ac6b7a1fc51f66dc9b1b16 Author: Alistair Thomas <astavale@yahoo.co.uk> Date: Sat Jun 11 14:02:32 2016 +0100 enchant: Minor fixes Remove superfluous cname_prefix namespace-attribute. Add get_version() and fix array-length-type of Dict.suggest().
Backport to 0.34 please.