Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Elizabeth Chastain <chastain@cygnus.com>
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	[thread overview]
Message-ID: <200107031529.IAA05742@bosch.cygnus.com> (raw)

* 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


             reply	other threads:[~2001-07-03  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-03  9:28 Michael Elizabeth Chastain [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-02 19:02 Michael Snyder
2001-07-03  8:48 ` Jim Blandy
2001-07-03 12:36   ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200107031529.IAA05742@bosch.cygnus.com \
    --to=chastain@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@cygnus.com \
    --cc=msnyder@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox