Skip to content

Releases: Abathargh/stropt

v0.4.0

Choose a tag to compare

@Abathargh Abathargh released this 22 Apr 14:45

This is a big release, with big changes to the core of the project which enable some pretty powerful things.

New Features

The main feature for this release is typedef support, together with a huge rework of the type and name extraction algorithm from the parsed C source.

Typedef support

  • Make it so that typedef'd names for aggregates are visible to the tool - e.g. stropt "test_t" "typedef struct { char a; } test_t; }" works

    • typedef support for structs
    • typedef support for unions
    • typedef support for enums
      • as aggregates
      • as sub-aggregates/fields
  • Support both struct example and example for non typedef types or for pre-typedef defs in typedef types

  • Add test cases for everything above

  • Add test cases for complex scenarios

    • Array of structs
    • Array with size defined with #define
    • Add test cases for GetAggregateName (before the rest since it's used in current parse tests)
  • Use cc.Translate from cznic/cc instead of cc.Parse

    • Finish reworking everything using ast.TranslationUnit for type information
    • Remove old code and make it work with the rest of the pipeline
    • Add docs for parsing rework
    • Add docs to extract.go
    • Refactor stropt.go and add more comments in printing to screen funcs
    • Add docs for enums
    • Make it work somehow without c compiler, since Translate forces a C
      compiler to be there (check examples in cc repo)

Other additions

  • Support constant arithmetic expressions in arrays

    • Additive and multiplicative expressions
    • Parentheses expressions
    • Support sizeof expressions
    • Support any combination of the above
  • Add a stdint.h hardcoded source file so that users do not have to use a compiler just for width-precise type

    • Using -use-compiler ignores this header file.
  • Update go version so the tool includes proper version numbers based on git tag

Fixes and QoL

  • Don't print layout for enums, print it with padding only for last one for unions
  • Fix union padding algorithm (wrong maximum size/alignment computation)
  • When using bare + optimize, don't print aggregates
  • Fix a bug where passing more than one width/align flags would only take in the first one and ignore the rest
  • Fix a bug where passing an union under analysis prints just one field

v0.3.0

Choose a tag to compare

@Abathargh Abathargh released this 18 Feb 20:08

New Features

  • the tool now understands and knows hot to handle enums, both for definitions and as fields in aggregates.
  • adding a -enum argument to pass the enum size/alignment, defaulting to 4,4.

Fixes and QoL

  • fixed a bug where using avr mode activated the optimizer by mistake.

Attached to this release, you can find pre-compiled binaries for v0.3.0 of stropt.

v0.2.0

Choose a tag to compare

@Abathargh Abathargh released this 19 Dec 07:38

New Features

  • stropt does not need a compiler installed on the machine anymore, if not using include directives
  • -32bit mode and -avr mode, which set widths and alignments for base types automatically.
  • build facilities

Fixes and QoL

  • More test coverace
    Attached to this release, you can find pre-compiled binaries for v0.2.0 of stropt.

v0.1.0

Choose a tag to compare

@Abathargh Abathargh released this 07 Dec 14:19

First release for stropt!

Read about all the features in the README file