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 に答える