Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongful "ERROR ECOCOFI00" When Compiling Constants In .pl Program Files #108

Open
wbraswell opened this issue Oct 13, 2020 · 0 comments
Open

Comments

@wbraswell
Copy link
Owner

This issue was first reported by @birdty

The following file hello_world_constants.pl should compile without any errors:

#!/usr/bin/env perl

# [[[ HEADER ]]]
use RPerl;
use strict;
use warnings;
our $VERSION = 0.001_000;

# [[[ CRITICS ]]]
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls)  # USER DEFAULT 1: allow numeric values & print operator
## no critic qw(ProhibitConstantPragma ProhibitMagicNumbers)  # USER DEFAULT 3: allow constants

# [[[ CONSTANTS ]]]
use constant PIE => my string $TYPED_PIE = 'pecan';

# [[[ OPERATIONS ]]]
print PIE() . "\n";
print 'Hello, World!', "\n";

However, we see there are issues when attempting to compile a constant such as PIE() inside a .pl file:

someuser@somemachine:/tmp/rperl_tmp$ rperl -v

This is RPerl version 5.002_000, Long Date 20191128, Star Date 2019.332, Codename Skylab 2
v5.002_000 using RPerl's underscore-is-comma numbering scheme
v5.002000  using  CPAN's underscore-is-beta  numbering scheme
...


someuser@somemachine:/tmp/rperl_tmp$ rperl hello_world_constants.pl

[[[ BEGIN 'use Inline' STAGE for 'RPerl/HelperFunctions.cpp' ]]]
[[[ END   'use Inline' STAGE for 'RPerl/HelperFunctions.cpp' ]]]
Having more than one /x regexp modifier is deprecated at /home/someuser/perl5/lib/perl5/Perl/Critic/Policy/ValuesAndExpressions/RequireInterpolationOfMetachars.pm line 110.
Verbose Flag......... 0
Debug Flag........... 0


in rperl, have $RPerl::DEBUG   = 0, $ENV{RPERL_DEBUG}   = 1
in rperl, have $RPerl::VERBOSE = 0, $ENV{RPERL_VERBOSE} = 1
Input File:         hello_world_constants.pl
Output File(s):     hello_world_constants.cpp  hello_world_constants
Modes:              magic => LOW, code => CPP, ops => CPP, types => CPP, check => TRACE, uncompile => OFF, compile => SUBCOMPILE, subcompile => DYNAMIC, parallel => OFF, execute => ON, label => ON

DEPENDENCIES:       Follow & find all deps...    0 found.
PARSE PHASE 0:      Check     Perl syntax...        done.
PARSE PHASE 1:      Criticize Perl syntax...        done.
PARSE PHASE 2:      Parse    RPerl syntax...        done.
GENERATE:           Generate   C++ syntax...       Use of uninitialized value in hash element at /home/someuser/github_repos/rperl-latest/lib/RPerl/CompileUnit/Constant.pm line 113.
Use of uninitialized value in hash element at /home/someuser/github_repos/rperl-latest/lib/RPerl/CompileUnit/Constant.pm line 127.
 done.

ERROR ECOCOFI00, COMPILER, SAVE OUTPUT FILES: Expecting file name for suffix 'H', but received empty or no value, croaking at /home/someuser/github_repos/rperl-latest/script/rperl line 850.

BAILING OUT:        One or more problems encountered, see error messages above for details, dying

These errors are not present if we simply remove the constant PIE() from the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant