bug-glibc
[Top][All Lists]
Advanced

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

Invalid code in _G_config.h


From: John H. Spicer
Subject: Invalid code in _G_config.h
Date: Mon, 14 Jan 2002 09:28:17 -0500

The version of _G_config.h that is included in RedHat 7.2 contains the
following code:

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.

John Spicer
Edison Design Group



reply via email to

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