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

-Wstrict-prototypes and void foo () {}


The docs for -Wstrict-prototypes say

  Warn if a function is declared or defined without specifying the
  argument types.  (An old-style function definition is permitted without
  a warning if preceded by a declaration which specifies the argument
  types.)

I wonder if an exception to the "if preceded ..." clause can be made
for function definitions with no arguments.

Having to go and change lots of function definitions from

void
foo ()
{
  // mumble ...
}

to

void
foo (void)
{
  // mumble ...
}

is a pain _and_ an eyesore.


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