Skip to content

Lexer: Warning when compiling lexer.c #636

@marcoroth

Description

@marcoroth

I guess this is related to #632

compiling ../../../../ext/herb/../../src/lexer.c
../../../../ext/herb/../../src/lexer.c:91:47: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
   91 |       lexer->current_position = lexer->source.length;
      |                               ~ ~~~~~~~~~~~~~~^~~~~~
1 warning generated.

We might want to explicitly cast it or change the length to be a uint32 as well. Or is there a reason why we kept that as a size_t?

/cc @timkaechele

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions