summaryrefslogtreecommitdiff
path: root/warnings.h
Commit message (Collapse)AuthorAgeFilesLines
* fix incorrect vi filetype declarations in generated filesLukas Mai2023-03-241-1/+1
| | | | | Vim's filetype declarations are case sensitive. The correct types for Perl, C, and Pod are perl, c, and pod, respectively.
* warnings.pm - add deprecated::version_downgrade categoryYves Orton2023-03-181-4/+9
| | | | | This also fixes the version_downgrade to show the correct version that version downgrades will be removed in.
* warnings.pm - add deprecated::goto_construct categoryYves Orton2023-03-181-30/+32
| | | | | This category applies to attempts to goto the internals of a block construct.
* warnings.pm - add deprecated::delimiter_will_be_paired categoryYves Orton2023-03-181-3/+8
| | | | | | Some delimiters are considered deprecated because in the future they will be used as part of a paired delimiter. This adds a new category for these cases.
* warnings.pm - add deprecated::apostrophe_as_package_separator as new ↵Yves Orton2023-03-181-4/+9
| | | | | | | deprecation category This category is about use of apostrophe as a package separator, eg for things like "Test::More::isn't()".
* warnings.pm - support deprecated::unicode_property_name categoryYves Orton2023-03-181-27/+32
| | | | | | This category is only used in the regex engine, we should be able to disable it specifically, as it seems like we will never actually remove demove support for the things it warns about.
* warnings.pm - add deprecated::dot_in_inc warings categoryYves Orton2023-03-181-13/+18
| | | | | Instead of using a generic warnings category switch to fine grained control.
* warnings.pm - support deprecated::smartmatch categoryYves Orton2023-03-181-0/+5
| | | | | | | | | | | | | | | | Currently we seem to lack a way to have a subcategory under deprecated. It seems reasonable to me that people might want to disable a specific subcategory warning while leaving the rest in place. This patch allows that. Note that both no warnings "deprecated"; and no warnings "deprecated::smartmatch"; work to disable the warning. Deprecated warnings shouldn't be "all or nothing", they should be specific and targetted.
* Deprecate smartmatchPhilippe Bruhat (BooK)2023-02-251-22/+20
| | | | | Make the 'experimental::smartmatch' warning obsolete, and use 'deprecated' instead.
* generated files - update mode lines to specify file typeElvin Aslanov2023-02-191-2/+2
| | | | | | | | | | This updates the mode-line for most of our generated files so that they include file type information so they will be properly syntax highlighted on github. This does not make any other functional changes to the files. [Note: Commit message rewritten by Yves]
* Initial attack at basic 'class' featurePaul "LeoNerd" Evans2023-02-101-0/+5
| | | | | | | | | | | | | Adds a new experimental warning, feature, keywords and enough parsing to implement basic classes with an empty `new` constructor method. Inject a $self lexical into method bodies; populate it with the object instance, suitably shifted Creates a new OP_METHSTART opcode to perform method setup Define an aux flag to remark which stashes are classes Basic implementation of fields. Basic anonymous methods.
* cop.h - get rid of the STRLEN* stuff from cop_warningsYves Orton2022-11-021-7/+6
| | | | | With RCPV strings we can use the RCPV_LEN() macro, and make this logic a little less weird.
* warnings.h - length guard cop_warnings bitvector checksYves Orton2022-11-021-2/+7
|
* op.c - use refcounted pv pointers for cop_warningsYves Orton2022-11-011-1/+1
| | | | | | this allows multiple ops to share the same underlying warning bit vector. the vectors are not deduped, however they are efficiently copied and shared.
* Reclaim unused bits in ${^WARNING_BITS}Philippe Bruhat (BooK)2022-09-241-41/+24
| | | | | | | | | | | | | | | | | | `no warnings 'experimental::foo';` is effectively a no-op if the `foo` feature is not experimental any more. So, stop reserving bits in `${^WARNING_BITS}` for them, and silently do nothing when they are enabled or disabled via `use warnings` or `no warnings`. Warnings turned into no-op in this commit: * experimental::alpha_assertions * experimental::bitwise * experimental::isa * experimental::lexical_subs * experimental::postderef * experimental::script_run * experimental::signatures
* Add 'extra paired delimiters' featureKarl Williamson2022-03-191-2/+4
| | | | | When this feature is enabled, one can use many more string delimiters that have an opening version and a mirrored closing one.
* Add a new 'scalar' warnings categoryPaul "LeoNerd" Evans2022-03-081-0/+2
|
* Add a new 'experimental::snail_in_signatures' warning categoryPaul "LeoNerd" Evans2022-01-311-3/+5
|
* Add experimental::builtin warningPaul "LeoNerd" Evans2022-01-251-5/+7
|
* Add a new warning experimental::for_list.Nicholas Clark2021-10-151-0/+2
|
* Create `defer` syntax and `OP_PUSHDEFER` opcodePaul "LeoNerd" Evans2021-08-251-0/+5
| | | | | | | | | | | | | | | Adds syntax `defer { BLOCK }` to create a deferred block; code that is deferred until the scope exits. This syntax is guarded by use feature 'defer'; Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field gives the start of an optree to be deferred until scope exit. That op pointer will be stored on the save stack and invoked as part of scope unwind. Included is support for `B::Deparse` to deparse the optree back into syntax.
* warnings.h: Use cast instead of bitwise &Karl Williamson2021-07-301-4/+4
| | | | This saves that instruction
* Remove :win32 PerlIO layerLeon Timmermans2021-06-281-14/+12
|
* Initial attempt at feature 'try'Paul "LeoNerd" Evans2021-02-041-0/+5
| | | | | | | | | * Add feature, experimental warning, keyword * Basic parsing * Basic implementation as optree fragment See also https://github.com/Perl/perl5/issues/18504
* style: Detabify regen files.Michael G. Schwern2021-01-171-8/+8
| | | | | | | | | | | They generate C files. Bump feature.pm and warnings.pm versions to satisfy cmpVERSION.pl. I can't get it to easily ignore whitespace, `git diff --name-only` does not respect the -w flag. regen_perly.pl is left alone. That would require rebuilding perly.* which is beyond a simple indentation change.
* Rename internal macros in warnings.hKarl Williamson2020-10-071-5/+5
| | | | | | | | | | | This header defines 3 macros that are visible to XS code, but not for direct use of that code (they are not API). At least two of them are so short and generic that they could quite possibly conflict with symbols in that code 'Bit' and 'Off'. The third is somewhat less likely, 'IsSet', but not great. Rename them so that they contain 'Perl', so don't pollute the XS namespace.
* regen/warnings.pl: Move some hidden podKarl Williamson2020-09-041-81/+81
| | | | | | | This is a long list of warning categories which doesn't print, but exists to indicate to downstream tools, such as Devel::PPPort that these categories exist and are documented. Move them to the end of the file so as to make the meat of things flow better.
* Document packWARN.?Karl Williamson2020-09-041-3/+12
|
* regen/warnings.pl: Collapse closely related podKarl Williamson2020-09-041-42/+14
| | | | | | Having separate entries for ckWARN ... ckWARN4 just clutters things up. Instead fairly recent extensions to our API generation mechanism allows these to be variants in a single entry.
* fixup to free_and_set_cop_warnings()David Mitchell2020-03-201-2/+2
| | | | | | | | | | | | | | | | | | | v5.31.9-156-g94c8b9c1f0 introduced the free_and_set_cop_warnings() macro. It's first argument expects a COP rather than a COP*. Its usage in S_restore_cop_warnings(() is to modify PL_cucop, but in order to pass a COP rather than a COP*, the original commit made a local copy of PL_curcop and ended up inadvertently updating the copy instead. This commit changes the maco so it expects a COP*, and updates the bulk of its callers to use &PL_compiling rather than PL_compiling, and fixes up S_restore_cop_warnings(). The symptoms were ASAN failures in a few test scripts including uni/parser.t and ext/XS-APItest/t/handy0*.t. (The S_restore_cop_warnings() function was only used by Perl__force_out_malformed_utf8_message(), so didn't cause many issues outside of test scripts which forced such "malformed "errors).
* Add macro to free and set cop_warningsNicolas R2020-03-161-0/+5
| | | | | This is avoiding the boilerplate to free the cop_warning string when setting it.
* Add the `isa` operatorPaul "LeoNerd" Evans2019-12-091-0/+5
| | | | | | | | | | | | | | | | | | Adds a new infix operator named `isa`, with the semantics that $x isa SomeClass is true if and only if `$x` is a blessed object reference that is either `SomeClass` directly, or includes the class somewhere in its @ISA hierarchy. It is false without warning or error for non-references or non-blessed references. This operator respects `->isa` method overloading, and is intended to replace boilerplate code such as use Scalar::Util 'blessed'; blessed($x) and $x->isa("SomeClass")
* Note that the warnings categories are documentedKarl Williamson2019-09-021-0/+79
| | | | | This generates a hidden apidoc entry for the warnings categories, for downstream processing, like Devel::PPPort.
* warnings.h: Add pod about finding the XS warning categoryKarl Williamson2019-09-021-0/+7
| | | | | The XS category names are easily derivable from the chart of perl-space categories.
* Add warning category for variable length lookbehindKarl Williamson2019-03-181-3/+4
|
* Add warnings category experimental::uniprop_wildcardsKarl Williamson2019-03-121-0/+1
|
* Add hook for Unicode private use overrideKarl Williamson2019-03-071-0/+4
| | | | | | | | | | I am starting to write a Unicode::Private_Use module which will allow one to specify the Unicode properties of private use code points, thus making them actually useful. This commit adds a hook to regcomp.c to accommodate this module. The changes are pretty minimal. This way we don't have to wait another release cycle to get it out there. I don't want to document this interface, until it's proven.
* add Perl_dup_warnings() and fix leakDavid Mitchell2019-02-271-4/+1
| | | | | | | | | | | | | | | | | The macro DUP_WARNINGS() was doing (approximately) new = CopyD(old, malloc(size), size); which, depending on how the CopyD macro expanded (e.g. on debugging builds), could result in its arguments being used multiple times, and thus malloc() being called multiple times, with the result of the earlier call(s) then leaking. Fix this by implementing DUP_WARNINGS using a new function, Perl_dup_warnings() that stores its intermediate values in local vars. This function isn't performance critical, as its usually only called once per cop creation at compile time.
* regen/warnings.pl: Fix undefined C behaviorKarl Williamson2019-01-051-2/+2
| | | | | | | | | This fixes compiler warnings "performing pointer arithmetic on a null pointer has undefined behavior" There are several ways to fix this. This one was suggested by Tomasz Konojacki++. Instead of trying to point to address 1 and 2, two variables are created, and we point to them. const is cast away.
* Add 'alpha_assertions' warnings categoryKarl Williamson2018-02-181-2/+3
| | | | This will be used in future commits.
* Add warning for script runs being experimentalKarl Williamson2017-12-241-4/+5
| | | | This will be used in later commits.
* put shadowing warnings in their own categoryZefram2017-12-061-0/+4
| | | | As proposed in [perl #125330].
* fix handling of registered warning categoriesZefram2017-11-151-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were some problems arising from some warning bitsets being shorter than others, which happens when registration of a new warning category makes new bitsets longer. Most obviously, if a scope used "use warnings 'all'" to turn on all warnings and then turned off some specific warnings, then that scope wouldn't get warnings for subsequently-registered warning categories, because its bitset doesn't extend to the bit controlling the new category. (If just "use warnings 'all'" was used, without any customisation, then a special hack made that work for new categories.) It was also possible for a longer bitset to get truncated by a warnings pragma, because the bitset editing code assumed that all bitsets are the same length. To fix this, first the warning bits for the "all" category have to change meaning. Unlike all other warning categories, the bits for "all" used to be set only when there were no warning categories disabled; disabling any would also clear the "all" bits. That was supporting the special hack mentioned above that the all-warnings bitset work for new categories. This exception is now removed, so the meaning of the "all" bits is now the more obvious meaning, of indicating the default treatment that the scope wants for warnings not falling into any category known to the bitset. In warnings::warnif() et al, if the caller's bitset is found to be too short to have a bit for the relevant category, then the setting for the "all" category is used instead. Because the length of a bitset is an integral number of bytes, but only two bits are used per category, the length of a bitset doesn't precisely indicate which categories had been registered by the time it was constructed. So the standard bitsets for the "all" category are now always filled to their byte length, with bits set preemptively for categories not yet registered that fall within the current bitset length. When a warnings pragma operates on a bitset, it first expands it to the preferred length, by duplicating the "all" bits for the categories covered by the new length. It is careful to maintain the length when combining the bitset with the standard bitsets for categories. When a bitset is read from ${^WARNING_BITS} or from caller(), the standard pWARN_ALL setting is no longer expanded by the core to $warnings::Bits{all}, because the core's short WARN_ALLstring will now be expanded correctly just like any other bitset. Fixes [perl #108778].
* ckDEAD: PL_curcop->cop_warnings only if PL_curcopDavid Mitchell2017-01-231-1/+2
| | | | | | | | | | | | | | RT #130621 In ckDEAD(), don't check the value of PL_curcop->cop_warnings unless PL_curcop is non-null. In the ticket above, the reason that PL_curcop is null is the less than optimal way that evals free their optree: ideally the optree should be attached to the eval CV and freed when the CV is; instead a separate SAVEFREEOP() is done. But that fix is for another time; regardless, ckDEAD() should have a PL_curcop != NULL guard anyway like isLEXWARN_on() etc already do.
* perlapi: Document ckWARN-type macrosKarl Williamson2016-12-141-0/+58
|
* Add experimental::declared_refs warn categFather Chrysostomos2016-07-171-0/+4
|
* [perl #128597] Crash from gp_free/ckWARN_dFather Chrysostomos2016-07-111-2/+4
| | | | | | | See the explanation in the test added and in the RT ticket. The solution is to make the warn macros check that PL_curcop is non-null.
* silence -Wparentheses-equalityDavid Mitchell2016-03-281-2/+2
| | | | | | | | | | | | | | | | | | Clang has taken it upon itself to warn when an equality is wrapped in double parentheses, e.g. ((foo == bar)) Which is a bit dumb, as any code along the lines of #define isBAR (foo == BAR) if (isBAR) {} will trigger the warning. This commit shuts clang up by putting in a harmless cast: #define isBAR cBOOL(foo == BAR)
* Remove experimental::lexical_topic warnings categoryFather Chrysostomos2015-09-291-14/+13
|
* Delete experimental autoderef featureAaron Crane2015-07-131-12/+11
|