-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
specIssues related to the FPP language specificationIssues related to the FPP language specification
Description
In the spec https://nasa.github.io/fpp/fpp-spec.html#Type-Names_String-Type-Names it says that string sizes must be in the range [0, 2^31), the wiki agrees with this.
The implementation doesn't allow 0:
fpp/compiler/lib/src/main/scala/analysis/CheckSemantics/FinalizeTypeDefs.scala
Lines 222 to 226 in 35ac2c9
| if (size > 0 && size <= Int.MaxValue) Right(t) | |
| else { | |
| val loc = Locations.get(id) | |
| Left(SemanticError.InvalidStringSize(loc, size)) | |
| } |
Not really sure what the implications of string size 0 are but presumably it could be useful if the string size configuredConstant use case is used and you want to disable a field? We should test to make sure compilation works with string size 0 without any warnings.
Metadata
Metadata
Assignees
Labels
specIssues related to the FPP language specificationIssues related to the FPP language specification
Type
Projects
Status
Backlog