Possible en double:
Can I make GCC warn on passing too-wide types to functions?Différence entre -Wconversion entre gcc et g ++
Tenir compte du programme de test suivant:
static void func(int a)
{
}
int main()
{
unsigned int b = 42;
func(b);
return 0;
}
Compiler avec gcc:
[email protected]:~/projects$ gcc -Wconversion testit.c testit.c: In function âmainâ: testit.c:11: warning: passing argument 1 of âfuncâ as signed due to prototype [email protected]:~/projects$
Mais, en g ++ il n'y a pas d'avertissement !:
[email protected]:~/projects$ g++ -Wconversion testit.c [email protected]:~/projects$
Quelle est la raison pour cela et est-il possible d'obtenir le même avertissement lors de la compilation du code C++?