From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
To: Alex Elder <aelder@sgi.com>
Cc: xfs-masters@oss.sgi.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
xfs@oss.sgi.com
Subject: [PATCH] xfs: Silence bounds checking compiler warning
Date: Thu, 23 Jun 2011 17:08:22 +0200 [thread overview]
Message-ID: <4E0356E6.30104@gmail.com> (raw)
gcc with -Warray-bounds generates a false positive on this
since xfs defines the struct with u8 name[1]; to be able to
add a tag at the end.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
---
fs/xfs/xfs_dir2_block.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 580d99c..09b4aed 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -1148,7 +1148,7 @@ xfs_dir2_sf_to_block(
((char *)block + XFS_DIR2_DATA_DOTDOT_OFFSET);
dep->inumber = cpu_to_be64(xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent));
dep->namelen = 2;
- dep->name[0] = dep->name[1] = '.';
+ dep->name[0] = ((__u8 *)dep->name)[1] = '.';
tagp = xfs_dir2_data_entry_tag_p(dep);
*tagp = cpu_to_be16((char *)dep - (char *)block);
xfs_dir2_data_log_entry(tp, bp, dep);
--
1.7.5.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
WARNING: multiple messages have this Message-ID (diff)
From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
To: Alex Elder <aelder@sgi.com>
Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] xfs: Silence bounds checking compiler warning
Date: Thu, 23 Jun 2011 17:08:22 +0200 [thread overview]
Message-ID: <4E0356E6.30104@gmail.com> (raw)
gcc with -Warray-bounds generates a false positive on this
since xfs defines the struct with u8 name[1]; to be able to
add a tag at the end.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
---
fs/xfs/xfs_dir2_block.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 580d99c..09b4aed 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -1148,7 +1148,7 @@ xfs_dir2_sf_to_block(
((char *)block + XFS_DIR2_DATA_DOTDOT_OFFSET);
dep->inumber = cpu_to_be64(xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent));
dep->namelen = 2;
- dep->name[0] = dep->name[1] = '.';
+ dep->name[0] = ((__u8 *)dep->name)[1] = '.';
tagp = xfs_dir2_data_entry_tag_p(dep);
*tagp = cpu_to_be16((char *)dep - (char *)block);
xfs_dir2_data_log_entry(tp, bp, dep);
--
1.7.5.4
next reply other threads:[~2011-06-23 15:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 15:08 Maarten Lankhorst [this message]
2011-06-23 15:08 ` [PATCH] xfs: Silence bounds checking compiler warning Maarten Lankhorst
2011-06-23 15:33 ` Maarten Lankhorst
2011-06-23 15:33 ` Maarten Lankhorst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E0356E6.30104@gmail.com \
--to=m.b.lankhorst@gmail.com \
--cc=aelder@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xfs-masters@oss.sgi.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.