public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Chinner <david@fromorbit.com>, xfs@oss.sgi.com
Subject: Re: [ANNOUNCE, DISCUSS] xfsprogs: libxfs-4.1-update branch created
Date: Wed, 13 May 2015 17:42:42 -0500	[thread overview]
Message-ID: <5553D362.501@sandeen.net> (raw)
In-Reply-To: <5553CF6D.9080501@sandeen.net>

On 5/13/15 5:25 PM, Eric Sandeen wrote:
> On 5/13/15 5:14 PM, Eric Sandeen wrote:
>> One interesting problem that arises from this is in xfs_format.h:
>>
>> /* On-disk XFS extended attribute names */
>> #define SGI_ACL_FILE            (char *)"SGI_ACL_FILE"
>> #define SGI_ACL_DEFAULT         (char *)"SGI_ACL_DEFAULT"
>> #define SGI_ACL_FILE_SIZE       (sizeof(SGI_ACL_FILE)-1)
>> #define SGI_ACL_DEFAULT_SIZE    (sizeof(SGI_ACL_DEFAULT)-1)
>>
>> (aside: why is it unsigned in the kernel but not here?)
>>
>> Anyway: that "sizeof" gives us 7, because it's getting the
>> size of the pointer, not the string literal.  Cool eh!
>> Never mattered in the kernel, because the _SIZE macros aren't
>> used.
>>
>> I'm not actually sure what the cleanest way to fix this is;
>> casting string literals gets way past my comfort level with
>> C pedantry; technically if we want an array of unsigned chars,
>> we probably need:
>>
>> unsigned char *SGI_ACL_FILE[] = "SGI_ACL_FILE";
>> unsigned char *SGI_ACL_DEFAULT[] = "SGI_ACL_DEFAULT";
> 
> Er, drop the * of course ...

I think we can just drop the ([unsigned] char *) bit and move on,
assigning the string literal to an unsigned char * should be fine.
Right?

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-05-13 22:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11  0:05 [ANNOUNCE, DISCUSS] xfsprogs: libxfs-4.1-update branch created Dave Chinner
2015-05-11  5:37 ` Christoph Hellwig
2015-05-11 12:39 ` Brian Foster
2015-05-11 13:20   ` Dave Chinner
2015-05-11 14:14     ` Brian Foster
2015-05-11 14:50   ` Eric Sandeen
2015-05-11 14:48 ` Eric Sandeen
2015-05-11 21:28   ` Dave Chinner
2015-05-11 23:47     ` Eric Sandeen
2015-05-13 22:14 ` Eric Sandeen
2015-05-13 22:25   ` Eric Sandeen
2015-05-13 22:42     ` Eric Sandeen [this message]
2015-05-14  1:04   ` Dave Chinner

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=5553D362.501@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=david@fromorbit.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox