After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767522 - enchant.vapi has an unneeded cname_prefix attribute
enchant.vapi has an unneeded cname_prefix attribute
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: Extra
0.32.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-11 06:32 UTC by Leonardo Robol
Modified: 2017-03-09 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Minimal example (393 bytes, text/x-vala)
2016-06-11 06:32 UTC, Leonardo Robol
  Details
Updated VAPI file (1.36 KB, text/x-vala)
2016-06-11 06:34 UTC, Leonardo Robol
  Details
Minor fixes to enchant.vapi (1.30 KB, patch)
2016-06-11 13:44 UTC, Al Thomas
committed Details | Review

Description Leonardo Robol 2016-06-11 06:32:45 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
Comment 1 Leonardo Robol 2016-06-11 06:34:10 UTC
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_").
Comment 2 Al Thomas 2016-06-11 13:44:18 UTC
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
Comment 3 Rico Tzschichholz 2017-03-08 19:07:29 UTC
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().
Comment 4 Daniel Espinosa 2017-03-09 15:23:14 UTC
Backport to 0.34 please.