This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Deprecate default-argument-on-function-type extension?
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: jason at redhat dot com, nathan at codesourcery dot com, gdr at codesourcery dot com
- Date: Thu, 11 Jul 2002 19:59:53 -0700
- Subject: Deprecate default-argument-on-function-type extension?
- Reply-to: mark at codesourcery dot com
G++ has an undocumented extension that allows you to say something
like:
void f(int);
void g() {
typedef void (*P)(int = 3);
P p = f;
(*p)();
}
This is cute, but it doesn't provide any major expressive power, and
it definitely muddies the type system. (Mostly, we consider ignore
the default arguments when thinking about the type, but I wouldn't be
surprised if we get things wrong in duplicate_decls if you have two
function declarations where a parameter to each function is itself a
function pointer with default arguments...)
I'd like to just drop this in the new parser, and, therefore,
deprecate it in the next major release.
Does anyone think we need to keep this?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com