public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Coding style for parameterless functions
Date: Tue, 5 Dec 2023 11:55:00 +0000	[thread overview]
Message-ID: <DM4PR11MB73034D6F4F8315D16CB1DF4EC485A@DM4PR11MB7303.namprd11.prod.outlook.com> (raw)

Hello,

I have a question regarding the coding style of parameterless
functions.  The internal document [1] gives an example where
they are written with the "void" keyword, like this:

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

  /* Definition */

  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?

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

Regards
-Baris


[1]: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Function_Definitions:_Function_Name_at_Column_Zero
[2]: https://sourceware.org/gdb/wiki/Internals%20GDB-Testsuite-Coding-Standards 


Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


             reply	other threads:[~2023-12-05 11:55 UTC|newest]

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

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=DM4PR11MB73034D6F4F8315D16CB1DF4EC485A@DM4PR11MB7303.namprd11.prod.outlook.com \
    --to=tankut.baris.aktemur@intel.com \
    --cc=gdb-patches@sourceware.org \
    /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).