Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Default initialization of integer fields #32

Closed
theoreticalbts opened this issue Jul 7, 2020 · 2 comments
Closed

Default initialization of integer fields #32

theoreticalbts opened this issue Jul 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@theoreticalbts
Copy link
Contributor

Currently integer fields aren't initialized in generated code. There are two ways this can be achieved:

  • (1) Instead of simple typedef of built-in integer types, integer types in basetypes.hpp should instead be custom types with proper default initializers (and presumably all arithmetic operators).
  • (2) Add code generator functionality to the C++ backend to default initialize fields of integer types, or typedefs of integer types.

Approach (2) will probably require extending the basetype declaration syntax to give us a way to tell the codegen "this type has this default initializer".

@sgerbino
Copy link
Member

sgerbino commented Feb 2, 2021

We want to use built in types where ever possible.

@sgerbino sgerbino closed this as completed Feb 2, 2021
@mvandeberg
Copy link
Member

Ran in to this bug when implementing #162

I am re-opening in support of the second solution.

@mvandeberg mvandeberg reopened this Mar 24, 2021
@sgerbino sgerbino added the enhancement New feature or request label Jun 11, 2021
@sgerbino sgerbino closed this as completed Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants