This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 03/10] The bits/types/*.h treatment for stdio and wchar.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: <libc-alpha at sourceware dot org>, <adhemerval dot zanella at linaro dot org>, <Wilco dot Dijkstra at arm dot com>, <fweimer at redhat dot com>, <carlos at redhat dot com>, <schwab at suse dot de>
- Date: Tue, 9 May 2017 21:34:23 +0000
- Subject: Re: [PATCH 03/10] The bits/types/*.h treatment for stdio and wchar.
- Authentication-results: sourceware.org; auth=none
- References: <20170509154103.11973-1-zackw@panix.com> <20170509154103.11973-4-zackw@panix.com>
On Tue, 9 May 2017, Zack Weinberg wrote:
> diff --git a/wcsmbs/bits/types/__mbstate_t.h b/wcsmbs/bits/types/__mbstate_t.h
> new file mode 100644
> index 0000000000..8eb95372f1
> --- /dev/null
> +++ b/wcsmbs/bits/types/__mbstate_t.h
> @@ -0,0 +1,19 @@
> +#ifndef ____mbstate_t_defined
> +#define ____mbstate_t_defined 1
> +
> +/* Conversion state information. */
> +typedef struct
> +{
> + int __count;
> + union
> + {
> +# ifdef __WINT_TYPE__
> + __WINT_TYPE__ __wch;
> +# else
> + wint_t __wch;
> +# endif
I'm concerned about the possible dependency this introduces on wint_t
having already been defined, if bits/types/__mbstate_t.h is included with
a compiler that does not define __WINT_TYPE__ (e.g. GCC 2.95 or earlier).
Previously, wchar.h would attempt to get a wint_t definition under
conditions that included !defined __WINT_TYPE__ - that is, it might
spuriously define wint_t when only asked to define __mbstate_t, given such
a compiler, but wouldn't define __mbstate_t in terms of an undefined type
wint_t.
Maybe you need a header that ensures __WINT_TYPE__ is always defined,
separate from bits/types/wint_t.h?
I have not exhaustively reviewed the rest of the patch.
--
Joseph S. Myers
joseph@codesourcery.com