diff options
author | Todd Rinaldo <toddr@cpan.org> | 2020-09-13 13:02:25 -0500 |
---|---|---|
committer | Sawyer X <xsawyerx@cpan.org> | 2020-09-15 17:37:44 +0300 |
commit | 19aaf9297b251db12d787e0eb31f06bfadc56856 (patch) | |
tree | 9421baafaf4f244a9904017883556b588dd4a2cd | |
parent | 9c705b6a737887a4da01ff0f1aee235dccb1ef26 (diff) | |
download | perl-19aaf9297b251db12d787e0eb31f06bfadc56856.tar.gz |
Add the Configure option to enable strict by default in perl programs.
Do not set strict by default on -e or -E
This is a development only feature to allow us to clean up blead.
./Configure -Dusedevel -des -Dusedefaultstrict
-rwxr-xr-x | Configure | 30 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux | 1 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux-n770 | 1 | ||||
-rw-r--r-- | NetWare/config.wc | 1 | ||||
-rw-r--r-- | Porting/Glossary | 5 | ||||
-rw-r--r-- | Porting/config.sh | 1 | ||||
-rwxr-xr-x | config_h.SH | 6 | ||||
-rw-r--r-- | configure.com | 1 | ||||
-rw-r--r-- | plan9/config_sh.sample | 1 | ||||
-rw-r--r-- | uconfig.h | 10 | ||||
-rw-r--r-- | uconfig.sh | 1 | ||||
-rw-r--r-- | uconfig64.sh | 1 | ||||
-rw-r--r-- | win32/config.gc | 1 | ||||
-rw-r--r-- | win32/config.vc | 1 |
14 files changed, 59 insertions, 2 deletions
@@ -234,6 +234,7 @@ useopcode='' useposix='' extras='' d_bsd='' +usedefaultstrict='' d_eunice='' d_xenix='' eunicefix='' @@ -20312,6 +20313,34 @@ EOCP ;; esac +: Ask about strict by default. +case "$usedefaultstrict" in + $define|true|[Yy]*) + dflt="y" + ;; + *) + dflt="n" + ;; + esac + +cat <<EOM + +EXPERIMENTAL: Perl can now be built with strict on by default when not +invoked with -e or -E. This is a diagnostic tool for development. + +Unless you are familiar with this feature, you should probably answer 'no'. + +EOM + +rp='Would you like to build perl with strict enabled by default?' +. ./myread +case "$ans" in +y|Y) val="$define" ;; +*) val="$undef" ;; +esac +set usedefaultstrict +eval $setvar + : Include . in @INC $cat <<EOM @@ -24168,6 +24197,7 @@ d_eofnblk='$d_eofnblk' d_erf='$d_erf' d_erfc='$d_erfc' d_eunice='$d_eunice' +usedefaultstrict='$usedefaultstrict' d_exp2='$d_exp2' d_expm1='$d_expm1' d_faststdio='$d_faststdio' diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux index 97b9255b2c..f340c8a505 100644 --- a/Cross/config.sh-arm-linux +++ b/Cross/config.sh-arm-linux @@ -1124,6 +1124,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='define' usedtrace='undef' diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770 index a2b9c544c5..5e15e32020 100644 --- a/Cross/config.sh-arm-linux-n770 +++ b/Cross/config.sh-arm-linux-n770 @@ -1122,6 +1122,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='define' usedtrace='undef' diff --git a/NetWare/config.wc b/NetWare/config.wc index 78de6d3bcd..5f55e121c5 100644 --- a/NetWare/config.wc +++ b/NetWare/config.wc @@ -1087,6 +1087,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='define' usedtrace='undef' diff --git a/Porting/Glossary b/Porting/Glossary index f70343e2e4..ce3a86b0c8 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -5547,6 +5547,11 @@ usecrosscompile (Cross.U): This variable conditionally defines the USE_CROSS_COMPILE symbol, and indicates that Perl has been cross-compiled. +usedefaultstrict (usedefaultstrict.U): + This setting provides a mechanism for perl developers to enable + strict by default. These defaults do not apply when perl is run + via -e or -E. + usedevel (Devel.U): This variable indicates that Perl was configured with development features enabled. This should not be done for production builds. diff --git a/Porting/config.sh b/Porting/config.sh index 05221be845..588600de4a 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -1158,6 +1158,7 @@ use64bitall='define' use64bitint='define' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='define' usedl='define' usedtrace='undef' diff --git a/config_h.SH b/config_h.SH index f3910f615a..c8313ecce9 100755 --- a/config_h.SH +++ b/config_h.SH @@ -3603,6 +3603,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$default_inc_excludes_dot DEFAULT_INC_EXCLUDES_DOT /**/ +/* USE_STRICT_BY_DEFAULT + * This symbol, if defined, enables additional defaults. + * At this time it only enables implicit strict by default. + */ +#$usedefaultstrict USE_STRICT_BY_DEFAULT /* use strict by default */ + /* USE_DYNAMIC_LOADING: * This symbol, if defined, indicates that dynamic loading of * some sort is available. diff --git a/configure.com b/configure.com index 20fc0590f6..e7ea8b9fcb 100644 --- a/configure.com +++ b/configure.com @@ -6988,6 +6988,7 @@ $ WC "use64bitall='" + use64bitall + "'" $ WC "use64bitint='" + use64bitint + "'" $ WC "usecasesensitive='" + be_case_sensitive + "'" ! VMS-specific $ WC "usedebugging_perl='"+use_debugging_perl+"'" +$ WC "usedefaultstrict='undef'" $ WC "usedefaulttypes='" + usedefaulttypes + "'" ! VMS-specific $ WC "usecbacktrace='undef'" $ WC "usecrosscompile='undef'" diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample index 29bd37d702..528e04422e 100644 --- a/plan9/config_sh.sample +++ b/plan9/config_sh.sample @@ -1095,6 +1095,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='undef' usedtrace='undef' @@ -3568,6 +3568,12 @@ */ /*#define DEFAULT_INC_EXCLUDES_DOT / **/ +/* USE_STRICT_BY_DEFAULT + * This symbol, if defined, enables additional defaults. + * At this time it only enables implicit strict by default. + */ +/*#define USE_STRICT_BY_DEFAULT / * use strict by default */ + /* USE_DYNAMIC_LOADING: * This symbol, if defined, indicates that dynamic loading of * some sort is available. @@ -5263,6 +5269,6 @@ #endif /* Generated from: - * 58be2e8a7742878937c4392bd15fffc7d0b555bedc9d028c791ea9b525806d52 config_h.SH - * 0328fd317c240be96131cf63f152ee17113e74b68e3dc0000e2876b9a0023713 uconfig.sh + * 01e063baa480bd3d905cba5dd04b87cd95a1053e64a1cc35884563a66548975e config_h.SH + * 4c3159a6a9875b7811c2a920d7936d5199193afdb163473c313b9531ba2c0648 uconfig.sh * ex: set ro: */ diff --git a/uconfig.sh b/uconfig.sh index a8a0714a39..7747dd6332 100644 --- a/uconfig.sh +++ b/uconfig.sh @@ -878,6 +878,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='undef' usedtrace='undef' diff --git a/uconfig64.sh b/uconfig64.sh index 2716afc04a..f87cb05850 100644 --- a/uconfig64.sh +++ b/uconfig64.sh @@ -878,6 +878,7 @@ use64bitall='define' use64bitint='define' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='undef' usedtrace='undef' diff --git a/win32/config.gc b/win32/config.gc index e263747821..b0af7d42e9 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -1119,6 +1119,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='define' usedtrace='undef' diff --git a/win32/config.vc b/win32/config.vc index b166ea1b70..234de8da62 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -1118,6 +1118,7 @@ use64bitall='undef' use64bitint='undef' usecbacktrace='undef' usecrosscompile='undef' +usedefaultstrict='undef' usedevel='undef' usedl='define' usedtrace='undef' |