public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: Coding style for parameterless functions
Date: Tue, 05 Dec 2023 07:36:13 -0700	[thread overview]
Message-ID: <87h6kwlns2.fsf@tromey.com> (raw)
In-Reply-To: <DM4PR11MB73034D6F4F8315D16CB1DF4EC485A@DM4PR11MB7303.namprd11.prod.outlook.com> (Tankut Baris Aktemur's message of "Tue, 5 Dec 2023 11:55:00 +0000")

>>>>> Aktemur, Tankut Baris <tankut.baris.aktemur@intel.com> writes:

>   /* Declaration */
>   static void foo (void);

> I couldn't find the exact email, but I remember quite well that in a
> discussion it was stated we should no longer use the void keyword
> since we started coding in C++.

> What's the current coding style that should be followed?

Use () in C++ code.  "(void)" is a C-ism.

> Also, the testsuite coding style document [2] explicitly states to write
> "(void)".  But note that input programs in the testsuite are usually C
> programs.

Yes, for C programs you have to do this.

thanks,
Tom

      reply	other threads:[~2023-12-05 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 11:55 Aktemur, Tankut Baris
2023-12-05 14:36 ` Tom Tromey [this message]

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=87h6kwlns2.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tankut.baris.aktemur@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).