Lou godio
2012-08-16 19:09:00 UTC
The following Inline::CPP code generates the following annoying warning
message:
'else if" is wrong syntax, correct if 'elsif'. Do you want to
continue ?
Does anyone have any ideas on where it's coming from, why and how to get
rid of it ??
use strict;
use warnings;
use Inline 'CPP' => 'DATA';
my( $p, $r, $n, $y ) = ( 600, 50, 2, 3 );
my $rv = interest( $p, $r, $n, $y );
print "\$rv: $rv\n";
__DATA__
__CPP__
double interest( double p, double r, int n, int y )
{
double result;
result = p/ (n*y) ;
if ( result == r ) return 0.0 ;
else if ( result < r ) return -1.0 ;
else return result;
}
*My system specifics*
Inline::CPP 0.39
DWIM Perl for Windows (Dwimperl-5.14.2.1-v7-32.exe released on 2012.02.12)
DWIM is a Strawberry Perl for Windows derivative (Strawberry Perl 5.14.2.1
RC ).
OS Windows XP (SP3) (32-bit)
===
*Contents of file lib\Inline\CPP\Config.pm*
package Inline::CPP::Config;
# Configuration data for CPP.pm; Compiler, libs, iostream filename,
#defines.
use strict;
use warnings;
our $VERSION = '0.38_004';
$VERSION = eval $VERSION; ## no critic (eval)
# DO NOT MANUALLY ALTER THE FOLLOWING TWO LINES: Makefile.PL locates them by
# matching their syntax and identifier names.
our $compiler = 'g++';
our $libs = '-lstdc++';
# DO NOT MANUALLY ALTER THE FOLLOWING LINE: Makefile.PL locates it by
# matching its syntax and identifier name.
our $iostream_fn = 'iostream';
# DON'T EDIT THIS HERE-DOC. These are set by Makefile.PL. Override
# by supplying undefs in an AUTO_INCLUDE configuration.
our $cpp_flavor_defs = <<'END_FLAVOR_DEFINITIONS';
#define __INLINE_CPP_STANDARD_HEADERS 1
#define __INLINE_CPP_NAMESPACE_STD 1
END_FLAVOR_DEFINITIONS
1;
__END__
=head1 Inline::CPP::Config
For internal consumption; nothing to document.
message:
'else if" is wrong syntax, correct if 'elsif'. Do you want to
continue ?
Does anyone have any ideas on where it's coming from, why and how to get
rid of it ??
use strict;
use warnings;
use Inline 'CPP' => 'DATA';
my( $p, $r, $n, $y ) = ( 600, 50, 2, 3 );
my $rv = interest( $p, $r, $n, $y );
print "\$rv: $rv\n";
__DATA__
__CPP__
double interest( double p, double r, int n, int y )
{
double result;
result = p/ (n*y) ;
if ( result == r ) return 0.0 ;
else if ( result < r ) return -1.0 ;
else return result;
}
*My system specifics*
Inline::CPP 0.39
DWIM Perl for Windows (Dwimperl-5.14.2.1-v7-32.exe released on 2012.02.12)
DWIM is a Strawberry Perl for Windows derivative (Strawberry Perl 5.14.2.1
RC ).
OS Windows XP (SP3) (32-bit)
===
*Contents of file lib\Inline\CPP\Config.pm*
package Inline::CPP::Config;
# Configuration data for CPP.pm; Compiler, libs, iostream filename,
#defines.
use strict;
use warnings;
our $VERSION = '0.38_004';
$VERSION = eval $VERSION; ## no critic (eval)
# DO NOT MANUALLY ALTER THE FOLLOWING TWO LINES: Makefile.PL locates them by
# matching their syntax and identifier names.
our $compiler = 'g++';
our $libs = '-lstdc++';
# DO NOT MANUALLY ALTER THE FOLLOWING LINE: Makefile.PL locates it by
# matching its syntax and identifier name.
our $iostream_fn = 'iostream';
# DON'T EDIT THIS HERE-DOC. These are set by Makefile.PL. Override
# by supplying undefs in an AUTO_INCLUDE configuration.
our $cpp_flavor_defs = <<'END_FLAVOR_DEFINITIONS';
#define __INLINE_CPP_STANDARD_HEADERS 1
#define __INLINE_CPP_NAMESPACE_STD 1
END_FLAVOR_DEFINITIONS
1;
__END__
=head1 Inline::CPP::Config
For internal consumption; nothing to document.