xfs
[Top] [All Lists]

Re: Use "const char *name" in extattr functions?

To: Craig Rodrigues <rodrigc@xxxxxxxxxxxxxx>
Subject: Re: Use "const char *name" in extattr functions?
From: Nathan Scott <nathans@xxxxxxx>
Date: Wed, 24 Aug 2005 15:34:19 +1000
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20050816011626.GA23116@crodrigues.org>
References: <20050816011626.GA23116@crodrigues.org>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.3i
Hi Craig,

On Mon, Aug 15, 2005 at 09:16:26PM -0400, Craig Rodrigues wrote:
> GCC gave me some problems when I tried passing "const char *" to 
> functions which took "char *" parameters for the attribute name.

With your patch gcc is still giving me problems, and it needed
a fair bit of tweaking just to get it to compile on Linux.
There was some issue because this...

>  typedef struct xfs_da_args {
> -     uchar_t         *name;          /* string (maybe not NULL terminated) */
> +     const uchar_t   *name;          /* string (maybe not NULL terminated) */
>       int             namelen;        /* length of string (maybe no NULL) */
>       uchar_t         *value;         /* set of bytes (maybe contain NULLs) */
>       int             valuelen;       /* length of value */

meant assignments to args.name in attr get/set/remove produced
compiler warnings which I just couldn't shake for some (still
unknown) reason...

In the end, I gave it up as a waste of time :) - I suggest you
either cast it to (char *) in the high level platform-specific
wrappers around the core XFS ext attr code (as is already done
for linux-2.6/xfs_iops.c actually).  If you really want to go
with your patch, please make it compile on Linux with a recent
gcc, without warnings (of course!), and resend... thanks.

cheers.

-- 
Nathan


<Prev in Thread] Current Thread [Next in Thread>