From: Philipp K. K. <pk...@sp...> - 2011-02-07 09:04:30
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 06.02.2011 18:28, schrieb Borut Razem: > - Philipp, what about changing the coding style of *.cc and *.hpp to be > sdcc compliant? > astyle --style=gnu --pad-oper --pad-header <source_file> Personally, I prefer the Allman style, but I've now run astyle to change it to the GNU style used throughout sdcc. However there's one little change in sdcc coding style I'd like to propose: GNU style mandates parentheses around logical or: if((A && B) || C) instead of if(A && B || C) which is meant to help people that don't know about operator precedence. IMO && taking precedence over || is as natural as for * over +, since && takes precedence over || in all of computer science just as * does over + in math. Furthermore sdcc being a C compiler, sdcc developers probably know more about operator precedence than the average programmer. I therefore suggest that the latter style (the one without extra parentheses) be allowed in sdcc. Philipp -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1PtYgACgkQbtUV+xsoLprECQCfWRS5pXWmXqL1fpnpgAr+qPNh ycUAoN86A6FQEdqHdvS3YsVe1IUSaWpL =IW8K -----END PGP SIGNATURE----- |