Thread (8 messages) flat view 8 messages, 4 authors, 2016-08-13
STALE3673d

[PATCH] diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warning

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:41
Subsystem: the rest · Maintainer: Linus Torvalds

Wrap "S_IFREG | 0644" in parentheses to avoid a "suggest parentheses
around arithmetic in operand of |" warning from GCC 4.1.3 on NetBSD
5.0.2.

I spotted and fixed this independently on NetBSD, but later found that
there was a NetBSD Problem Report that included this fix.

NetBSD-PR: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42168
Reported-by: Dan McMahill <redacted>
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 builtin/diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/diff.c b/builtin/diff.c
index a43d326..e8b7e09 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -93,7 +93,7 @@ static int builtin_diff_blobs(struct rev_info *revs,
 			      int argc, const char **argv,
 			      struct blobinfo *blob)
 {
-	unsigned mode = canon_mode(S_IFREG | 0644);
+	unsigned mode = canon_mode((S_IFREG | 0644));
 
 	if (argc > 1)
 		usage(builtin_diff_usage);
-- 
1.7.3.159.g610493
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help