8000 alpha Objective 3: warnings by default · Issue #154 · atoomic/perl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
alpha Objective 3: warnings by default #154
Open
@jkeenan

Description

@jkeenan

Objective: Implement 'warnings-by-default'.

Modify the guts such that all programs run against a Perl 7 executable run with warnings turned on by default. The statement use warning; should become a "no-op" except where a particular file has previously called some variant of no warnings;.

No other guts changes except those needed to implement this objective.

Initially, there will be many files in the test suite that will emit warnings once we have warnings turned on by default. How we handle these warnings will depend on the situations in each case. Broadly speaking, we can handle warnings in one of three ways:

  • If the warning is pointing to something that is truly problematic about the code in the test file, then we should fix the test file to eliminate the problem being warned about.

  • If the warning is being emitted in a particular instance is important, then we should capture the warning, (e.g., via $SIG{__WARN__}) and then write unit tests for either the content of the warning and/or the count of warnings emitted.

  • If the warning is of lesser importance (like, say, many "uninitialized value" warnings), then we can quiet the warning with code like:

no warnings 'uninitialized';

However, such suppression of warnings should be confined to a narrow scope around the statement which is generating warnings.

Examples: This three-way division of ways of handling warnings is illustrated in the slides beginning here.

Some files in the test suite may already been brought into compliance with both warnings-by-default by the application of cherry-picked code in the preceding objective, strict-by-default. We will also be able to cherry-pick commits from work in earlier branches that fixes problems addressed in other objectives still to come. For example, we have already revised many test files to avoid indirect object syntax. There is no big harm in cherry-picking such commits, provided that we do it judiciously.

Acceptance Criteria: The changes needed to have Perl run with warnings turned on by default are clearly available from the commit history and documented in the commit log. The Perl test suite runs GREEN in all major configurations and on all major operating systems for which we can test. Running the Perl test suite with Perl 7 semantics displays no more warnings than it would when run against a Perl 5 executable in the same configuration and on the same platform.

Note: This objective will probably require more work than any other. We should strongly consider recruiting other Perl developers to help us with this work. After this objective is met, the remaining objectives should be much easier to meet.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0