git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] CodingGuidelines: Add a note to avoid assignments inside if()

From
Miklos Vajna <vmiklos@frugalware.org>
Date
May 22, 2008, 23:26 UTC
Message-ID
<1211498769-26871-1-git-send-email-vmiklos@frugalware.org>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

I just had to ask Dscho about this. Better if it's documented, I suppose.

 Documentation/CodingGuidelines |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 994eb91..d2a0a76 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -89,6 +89,8 @@ For C programs:
    of "else if" statements, it can make sense to add braces to
    single line blocks.
 
+ - We try to avoid assignments inside if().
+
  - Try to make your code understandable.  You may put comments
    in, but comments invariably tend to stale out when the code
    they were describing changes.  Often splitting a function
-- 
1.5.5.1.357.g1af8b.dirty
Next: Junio C Hamano
Message 1 of 2 in “CodingGuidelines: Add a note to avoid assignments inside if()”
  1. CodingGuidelines: Add a note to avoid assignments inside if()Miklos Vajna, May 22, 2008
  2. Junio C HamanoMay 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.