This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #17657] Return allocated array instead array on stack.
- From: Torvald Riegel <triegel at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Andreas Schwab <schwab at suse dot de>, libc-alpha at sourceware dot org
- Date: Mon, 15 Dec 2014 16:03:20 +0100
- Subject: Re: [PATCH][BZ #17657] Return allocated array instead array on stack.
- Authentication-results: sourceware.org; auth=none
- References: <20141210132153 dot GA6395 at domone> <mvmppbrtx3i dot fsf at hawking dot suse dot de> <20141210143252 dot GA27265 at domone> <mvmbnnbtv76 dot fsf at hawking dot suse dot de> <20141210151334 dot GA27824 at domone>
On Wed, 2014-12-10 at 16:13 +0100, OndÅej BÃlka wrote:
> diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
> index 67846b3..eeaf645 100644
> --- a/locale/programs/ld-ctype.c
> +++ b/locale/programs/ld-ctype.c
> @@ -114,6 +114,9 @@ struct translit_include_t
> struct translit_include_t *next;
> };
>
> +/* Provide some dummy pointer for empty string. */
> +static uint32_t no_str[] = { 0 };
> +
>
> /* Sparse table of uint32_t. */
> #define TABLE idx_table
[...]
> @@ -4090,9 +4093,6 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
> }
> else
> {
> - /* Provide some dummy pointers since we have nothing to write out. */
> - static uint32_t no_str = { 0 };
> -
> ctype->translit_from_idx = &no_str;
> ctype->translit_from_tbl = &no_str;
> ctype->translit_to_tbl = &no_str;
This 'no_str' and the one you introduced above are different. You need
to drop the &'s here. Did you build and test with warnings enabled? A
fairly recent GCC complains about the different pointer types.