odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.13k stars 547 forks source link

Hexadecimal number on `-define` build flag - silent compiler crash #2509

Open awwdev opened 1 year ago

awwdev commented 1 year ago

Context

Odin dev-2023-01 Windows

Bug

Test :: #config(Test, 0)
main :: proc() {
    fmt.println(Test) 
}

Build flag:

-define:Test=35e4218 

The compiler will silently crash (without an error message) and exit with code 1. Seems like the hexadecimal number is the problem.

Workaround: Prefix the hexadecimal number with 0x and the compiler will accept it.

Feoramund commented 3 weeks ago

Looks like this is working now. Hexadecimal numbers not prefixed with 0x will be treated as strings.