Discussion:
Inline::CPP annoying warning message
Lou godio
2012-08-16 19:09:00 UTC
Permalink
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.
David Oswald
2012-08-16 19:32:09 UTC
Permalink
Post by Lou godio
The following Inline::CPP code generates the following annoying warning
'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 ??
Ah hah! This is a Padre error message. It's coming from your IDE.
Run the code from a fresh command prompt that isn't launched by the
IDE and see what happens.

I was able to search using your error message and found this link:

http://irclog.perlgeek.de/padre/2012-01-31

This is why it's so important to paste the actual error message; any
variation from the actual message can make it un-searchable.

Anyway, see if running it from the command-prompt fixes it. I bet it will.

(For those joining us on inline@, I've been scratching my head over
this for a day or so now, and finally encouraged the OP to post here.
But it became clearer -- hopefully -- with a cleaner paste of the
error message.)
--
David Oswald
daoswald-***@public.gmane.org
Loading...