Character string type does not comply with ISO 7185 Section 6.1.7
Original Reporter info from Mantis: profw
-
Reporter name: William M. Waite
Original Reporter info from Mantis: profw
- Reporter name: William M. Waite
Description:
According to ISO 7185, Section 6.1.7 "A character-string containing more than one string-element shall denote a value of
a string-type (see 6 .4 .3 .2) with the same number of components as the character-string contains
string-elements . All character-strings with a given number of components shall possess the same
string-type." Apparently the compiler actually regards all literal string constants as being of the same type.
Steps to reproduce:
Declare a variable as a string type: c: packed array [1..5] of char;
Assign a string constant supposedly of a different string type: c := '1234567890';
No error is reported, and c is assigned the first five characters of the constant.
See the attached file, which tests both longer and shorter string constants.
Mantis conversion info:
- Mantis ID: 38439
- Build: 2020/05/31
- Version: 3.2.0
- Fixed in version: 3.3.1
- Fixed in revision: 48563 (#ecce39a3)
- Monitored by: » @KaiBurghardt (Kai Burghardt)