From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Elizabeth Chastain To: jimb@cygnus.com, msnyder@cygnus.com Cc: chastain@cygnus.com, gdb-patches@sources.redhat.com Subject: Re: V3 fixes for classes.exp Date: Tue, 03 Jul 2001 09:28:00 -0000 Message-id: <200107031529.IAA05742@bosch.cygnus.com> X-SW-Source: 2001-07/msg00029.html * Make the "void" optional in constructors with no params At first, I thought that MichaelS was talking about the "void" return type that gdb is showing for constructors. This is bogus and the test suite is correct when it FAILs this output. But when I actually read the patch, I saw that he was talking about parameter types for functions that have no params: - \\(void\\) + \\((void|)\\) With v2 g++, I see a lot of "foo(void)". With v3 g++, these show up as "foo()". I think these changes are fine. I haven't reviewed and tested the whole patch yet so I can't recommend it yet. History note: in the beginning, there were a lot of C header files with declarations like "foo()", with no parameters (to be compatible with K&R C). Ansi C and C++ wanted to glom onto those header files, so they had to adopt the convention that "foo()" declares a function with unspecified parameters, whereas "foo(void)" declares a function with zero parameters. C++ is abandoning K&R C, so the C++ convention is that "foo()" declares a function with zero parameters. So header files from 1985 don't work anymore. This history gets reflected in the demangler output. So we have to cope with both "foo(void)" and "foo()", depending on the compiler. This is easy to do when parsing output. It requires more work when the test script is providing input (such as breaking on either "foo(void)" or "foo()". MichaelC