bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invalid code in _G_config.h


From: Andreas Schwab
Subject: Re: Invalid code in _G_config.h
Date: Mon, 14 Jan 2002 17:36:39 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.30 (ia64-suse-linux)

Andreas Jaeger <address@hidden> writes:

|> "John H. Spicer" <address@hidden> writes:
|> 
|> > The version of _G_config.h that is included in RedHat 7.2 contains the
|> > following code:
|> >
|> 
|> And before that code we do an include of <gconv.h>
|> > typedef union
|> > {
|> >   struct __gconv_info __cd;
|> >   struct
|> >   {
|> >     struct __gconv_info __cd;
|> >     struct __gconv_step_data __data;
|> >   } __combined;
|> > } _G_iconv_t;
|> >
|> > This note the use of __gconv_info in the struct.  This is prohibited by
|> > the C99 standard (6.7.2.1), which says:
|> >
|> >        [#2] A structure or union shall not contain  a  member  with
|> >        incomplete  or  function  type (hence, a structure shall not
|> >        contain an instance of itself, but may contain a pointer  to
|> >        an  instance  of  itself),  except that the last member of a
|> >        structure  with  more  than  one  named  member   may   have
|> >        incomplete  array  type;  such  a  structure  (and any union
|> >        containing, possibly recursively, a member that  is  such  a
|> >        structure)  shall  not  be  a  member  of  a structure or an
|> >        element of an array.
|> 
|> But __gconv_info is declared in <gconv.h>.
|> 
|> I don't understand the problem you see, please give some more details,

struct __gconv_info is an incomplete type due to the flexible array
member.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]