Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
how to let gcc warn me when I use = in conditions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="websnarf, post: 2419271"] Making a mistake by switching the from and to variables about a single "=" is rare. When testing the assignment of a variable I usually write it as: if (0 != (a = b)) ... since the compiler will have no trouble removing the "0 !=" internally. gcc with -Wall -ansi -pedantic seems to be perfectly happy with the form I suggest. So do all the other 4 main compilers that I use with their warnings set at maximum. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
how to let gcc warn me when I use = in conditions
Top