This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR bootstrap/53459 - unused local typedef when building on altivec


On Fri, May 25, 2012 at 10:11:54AM +0200, Dodji Seketeli wrote:
> --- a/libcpp/lex.c
> +++ b/libcpp/lex.c
> @@ -589,8 +589,8 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
>  
>    {
>  #define N  (sizeof(vc) / sizeof(long))
> -
> -    typedef char check_count[(N == 2 || N == 4) * 2 - 1];
> +    /* The below is a static assertion.  */
> +    extern char check_count[(N == 2 || N == 4) * 2 - 1];
>      union {
>        vc v;
>        unsigned long l[N];

Alternatively you could put the static assertion with the comment
into the l field, i.e.
	/* Statically assert that N is 2 or 4.  */
	unsigned long l[(N == 2 || N == 4) ? N : -1];

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]