$ g++ -o virgule virgule.cpp && ./virgule
0
$ g++ -Wall -o virgule virgule.cpp && ./virgule
virgule.cpp: In function ‘int main()’:
virgule.cpp:4:12: attention : right operand of comma operator has no effect [-Wunused-value]
0
$ g++ -Wunused-value -o virgule virgule.cpp && ./virgule
virgule.cpp: In function ‘int main()’:
virgule.cpp:4:12: attention : right operand of comma operator has no effect [-Wunused-value]
0
[^] # Re: Clang vs GCC
Posté par Benoît Sibaud (site web personnel) . En réponse à la dépêche LLVM 3.2 et Clang 3.2 publiés. Évalué à 2.
Test avec g++ 4.6.3
Remplaçons la ligne par :
Et c'est aussi valable en C :