CMakePP / CMakePPLang

Object-oriented extension to the CMake language.
http://cmakepp.github.io/CMakePPLang/
Apache License 2.0
11 stars 4 forks source link

Ints with 3 or more digits are typed as floats #13

Closed blakemulnix closed 4 years ago

blakemulnix commented 4 years ago

Due to an error in the regex pattern for matching floats in types/float.cmake's cpp_is_float function, integers that have 3 or more digits are typed as floats.

For example:

set(arg1 1)
set(arg2 12)
set(arg3 123)
set(arg4 123456)

cpp_type_of(type1 "${arg1}")
cpp_type_of(type2 "${arg2}")
cpp_type_of(type3 "${arg3}")
cpp_type_of(type4 "${arg4}")

message("type1: ${type1}")
message("type2: ${type2}")
message("type3: ${type3}")
message("type4: ${type4}")

produces:

type1: int
type2: int
type3: float
type4: float

I would expect all floats to be typed as floats and ints to be typed as ints.

blakemulnix commented 4 years ago

Accidentally created a duplicate bug here. :grimacing: