Search code examples
warningshashtablevala

Warning : 'g_hash_table_iter_next from incompatible pointer type' with HashTagIter in Vala


The following code compile but raise warnings. So I would like to understand what happen really to correct it (I don't like the idea to have warnings at compilation) :

// Display couples
// words is a HashTable<string, int> with words and the number of matches in a text
var iter = HashTableIter<string, int>( words );
string key;
int val;
while ( iter.next( out key, out val ) == true )     // TODO Look what 'out' is for
{
    stdout.printf( "%s : %d\n", key, val );
}

The warnings :

/Users/horizon/Projets/voynich/src/Voynich.vala.c:534: warning: passing argument 2 of ‘g_hash_table_iter_next’ from incompatible pointer type
/Users/horizon/Projets/voynich/src/Voynich.vala.c:534: warning: passing argument 3 of ‘g_hash_table_iter_next’ from incompatible pointer type
/Users/horizon/Projets/voynich/src/Voynich.vala.c:538: warning: assignment makes integer from pointer without a cast

As I said, the code compile and it works well (no segfault or anything else for the moment).

How can I fix this warning ?

Thanks,

Damien


Solution

  • Ignore CC warnings, you can't fix them. You only want to look at Vala warnings.