This is the mail archive of the gcc-bugs@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]

[Bug c++/28906] [4.2 regression] rejects valid arrays



------- Comment #8 from tbm at cyrius dot com  2006-08-31 20:10 -------
Is this the same bug?

(sid)59:tbm@usurper: ~/delta/bin] /usr/lib/gcc-snapshot/bin/g++ -c  mini.c
mini.c:40: error: variable-size type declared outside of any function
mini.c:40: error: variable-size type declared outside of any function


Testcase:

extern "C"
{
  typedef long unsigned int size_t;
  extern size_t strlen (__const char *__s) throw () __attribute__ ((__pure__))
    __attribute__ ((__nonnull__ (1)));
  struct addrinfo
  {
  }
  _G_fpos64_t;
  typedef unsigned char cc_t;
}
extern char *hostname;
extern char NetTraceFile[];
void SetNetTrace (const char *);
typedef struct
{
}
Clocks;
char **genget (const char *, char **, int);
struct setlist
{
  const char *name;
  const char *help;
  void (*handler) (const char *);
  cc_t *charp;
};
static struct setlist Setlist[] = {
  {
     "tracefile", "file to write trace information to", SetNetTrace,
     (cc_t *) NetTraceFile}
};
static struct setlist *
getset (const char *name)
{
  return (struct setlist *) genget (name, (char **) Setlist,
                                    sizeof (struct setlist));
  char *hostp = __null;
    {
      hostname = new char[strlen (hostp) + 1];
    }
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28906


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