This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix build warning in locarchive.c
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org, carlos at redhat dot com
- Date: Wed, 20 Nov 2013 13:43:22 +0100
- Subject: Re: Fix build warning in locarchive.c
- Authentication-results: sourceware.org; auth=none
- References: <20131120123516 dot GI19834 at spoyarek dot pnq dot redhat dot com>
On Wed, Nov 20, 2013 at 06:05:16PM +0530, Siddhesh Poyarekar wrote:
> Hi,
>
> I just noticed a minor build warning in locarchive.c where const char
> * is being implicitly cast to a char *. Attached patch fixes this.
> OK to commit?
>
> Siddhesh
>
> * locale/programs/locarchive.c (open_archive): Add const
> qualifier to ARCHIVEFNAME and copy default fname to
> DEFAULT_FNAME.
>
> diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
> index e796865..88e1172 100644
> --- a/locale/programs/locarchive.c
> +++ b/locale/programs/locarchive.c
> @@ -564,15 +564,15 @@ open_archive (struct locarhandle *ah, bool readonly)
> int retry = 0;
> size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
> char default_fname[prefix_len + sizeof (ARCHIVE_NAME)];
> - char *archivefname = ah->fname;
> + const char *archivefname = ah->fname;
>
ok with this or with adding cast like
char *archivefname = (char *) ah->fname;