Skip to content

Tracking issue for -C overflow-checks #33134

Closed

Description

@alexcrichton

Tracking issue for rust-lang/rfcs#1535

Activity

  1. alexcrichton commented on Feb 16, 2017

    @alexcrichton
    MemberAuthor

    FWIW this should be a relatively easy bug to knock out!

    The force_overflow_checks option is defined with other debugging options and we'd just want to add a new flag to the associated codegen options (we'll delete the -Z flag once everyone's migrated).

    There's a few uses throughout the codebase which I believe will need an update:

    After that we'd just need to add a test which validates this behavior, likely a src/test/run-pass/*.rs addition with a // compile-flags: ... annotation at the top.

    Likewise the Cargo support should be relatively easy:

  2. added
    E-help-wantedCall for participation: Help is requested to fix this issue.
    on Feb 16, 2017
  3. froydnj commented on Feb 16, 2017

    @froydnj
    Contributor

    I'd like to tackle this!

  4. froydnj commented on Feb 17, 2017

    @froydnj
    Contributor

    OK, so this is pretty straightforward. Couple questions after actually implementing this:

    • The RFC says the option is -C overflow-checks, but comments on the RFC suggest that people expect this to be -C overflow-checks(=on/off), so one could have (I guess) -C debug-assertions -C overflow-checks=off. Which variant should be supported?
    • It seems better to make the value in CodegenOptions the single source of truth to be used throughout the compiler by setting it based on the value of -C debug-assertions or -Z force-overflow-checks; this makes the uses easier to read and also makes any future removal of -Z force-overflow-checks straightforward. How should -C overflow-checks interact with -Z force-overflow-checks? Should we just consider any explicit setting of -C overflow-checks to "win" and only consult -Z force-overflow-checks if the -C option was not explicitly provided? I guess that would mean that we'd almost have to implement the -C overflow-checks(=on/off) variant above?
  5. alexcrichton commented on Feb 17, 2017

    @alexcrichton
    MemberAuthor

    @froydnj I think it's fine to just reuse the existing parse_opt_bool which accepts a "standard variety" of boolean options.

    It seems better to make the value in CodegenOptions the single source of truth

    Makes sense to me to have a single source of truth! Right now I don't think we have a lot of precedent for modifying CodegenOptions after creation so this may not be easy. Perhaps a helper method on Session though? That's what a few other codegen-like options do.

    How should -C overflow-checks interact with -Z force-overflow-checks?

    Yeah let's just have -C trump -Z. The precise semantics likely don't matter too much anyway as we'll quickly phase out the -Z version anyway.

  6. added 3 commits that reference this issue on Feb 25, 2017
    ffc6ddd
    e69d234
    582d5d9
  7. added a commit that references this issue on Nov 24, 2021
  8. added 3 commits that reference this issue on Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.E-help-wantedCall for participation: Help is requested to fix this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions