Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #539

Unused named function argument

Message-ID <61b7661d-5cbf-4246-93a2-4ab9dcc6ed12@googlegroups.com> (permalink)
Newsgroups comp.std.c++
From andrew.gottemoller@debesys.net
Subject Unused named function argument
Organization unknown
Date 2012-08-30 10:36 -0600

Show all headers | View raw


When compiling using gcc with, the below code will compile without any sort of error:


int foo (int)
{
     return 5;
}


Can the compilation result differ if I specify a name for the argument?

I can't see any way the naming of the parameter would ever make a difference in the actual compilation result.  The question arose because I noticed when compiling the following C program:


// Compile: gcc --std=c99 -c -pedantic -Wall -O3 foo.c
int foo (int)
{
     return 5;
}


The error: 'parameter name omitted' is output by the compiler.

Is there any non-obvious significance in the parameter name with C++11 or C99?


-- 
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextNext in thread | Find similar


Thread

Unused named function argument andrew.gottemoller@debesys.net - 2012-08-30 10:36 -0600
  Re: Unused named function argument James Kuyper <jameskuyper@verizon.net> - 2012-08-31 09:20 -0600
  Re: Unused named function argument Daniel Krügler<daniel.kruegler@googlemail.com> - 2012-09-05 11:24 -0700
    Re: Unused named function argument James Kuyper <jameskuyper@verizon.net> - 2012-09-06 13:04 -0600

csiph-web