1

以下代码编译但会引发警告。所以我想了解纠正它的真正情况(我不喜欢在编译时有警告的想法):

// 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 );
}

警告:

/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

正如我所说,代码编译并且运行良好(暂时没有段错误或其他任何东西)。

我该如何解决这个警告?

谢谢,

达米安

4

1 回答 1

2

忽略 CC 警告,您无法修复它们。您只想查看 Vala 警告。

于 2012-02-02T08:04:05.477 回答