Skip to content

VIP: Specify behavior of uninitialized variables #1493

@charles-cooper

Description

@charles-cooper

Simple Summary

Require newly declared variables to be initialized.

Abstract

Motivation

Uninitialized variables can currently refer to garbage memory (#1476 (comment)). Probably not what people expect.

Specification

option 1) Require variables to be set by the programmer
option 2) if the programmer declares a new variable without setting it, auto set it to a default value of 0

EDIT: the eventual consensus was to choose option 1. See #1493 (comment) for the rationale.

Backwards Compatibility

Programs which don't initialize variables will no longer compile.

Dependencies

Modifies existing behavior of creating new memory variables

Copyright

Copyright and related rights waived via CC0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions