On Thu Feb 26 18:04:18 2004, ingy@ttul.org wrote:
Show quoted text> > The stuff which parses the function headers for C seems not to
> recognise functions whose argument list is (void), which explicitly
> declares them as taking no arguments.
>
> That is true. Inline only parses type/name pairs. The special void
> case
> may be allowed in a future release.
>
This could possibly be addressed by the insertion of just one line into
C.pm's sub get_parser. That sub currently (as of Inline-0.45) reads:
sub get_parser {
my $o = shift;
require Inline::C::ParseRecDescent;
Inline::C::ParseRecDescent::get_parser($o);
}
I think the 'void' argument type is catered for if we change that to:
sub get_parser {
my $o = shift;
$o->{ILSM}{code} =~ s/\((\s+)*void(\s+)*\)/\(\)/g;
require Inline::C::ParseRecDescent;
Inline::C::ParseRecDescent::get_parser($o);
}
But, apart from the fact that doesn't work with the ParseRegExp.pm
parser, I'm a little concerned about its potential to introduce other
breakages. For example, a cast to void would probably break. (But do we
ever cast to void in C ?)
Anyway ... for mine, it's a lot easier (and safer) to leave things as
they are.
Cheers,
Rob