digitalmars.D.learn - Invalid string literal in ASM
- dokutoku (3/3) Oct 01 2018 I get a compiler error when I try to put non-ASCII characters in
I get a compiler error when I try to put non-ASCII characters in a string literal in the inline assembler. Is this part of the specifications?
Oct 01 2018
On Monday, 1 October 2018 at 08:14:07 UTC, dokutoku wrote:I get a compiler error when I try to put non-ASCII characters in a string literal in the inline assembler. Is this part of the specifications?It's not clear, see https://dlang.org/spec/iasm.html#raw_data: "if an operand is a string literal, it is as if there were length operands, where length is the number of characters in the string" db "e"; // ok db "é"; // error it seems that the second case should be accepted as db 195 db 169
Oct 01 2018
On Monday, 1 October 2018 at 09:24:47 UTC, Basile B. wrote:On Monday, 1 October 2018 at 08:14:07 UTC, dokutoku wrote:BUG imo. length is 2. "é" should be interpreted as the 2 bytes of its data. Something with decoding is wrong here.I get a compiler error when I try to put non-ASCII characters in a string literal in the inline assembler. Is this part of the specifications?It's not clear, see https://dlang.org/spec/iasm.html#raw_data: "if an operand is a string literal, it is as if there were length operands, where length is the number of characters in the string" db "e"; // ok db "é"; // error it seems that the second case should be accepted as db 195 db 169
Oct 01 2018
On Monday, 1 October 2018 at 10:45:25 UTC, Basile B. wrote:On Monday, 1 October 2018 at 09:24:47 UTC, Basile B. wrote:As a conclusion, is it OK to say DMD bug?On Monday, 1 October 2018 at 08:14:07 UTC, dokutoku wrote:BUG imo. length is 2. "é" should be interpreted as the 2 bytes of its data. Something with decoding is wrong here.I get a compiler error when I try to put non-ASCII characters in a string literal in the inline assembler. Is this part of the specifications?It's not clear, see https://dlang.org/spec/iasm.html#raw_data: "if an operand is a string literal, it is as if there were length operands, where length is the number of characters in the string" db "e"; // ok db "é"; // error it seems that the second case should be accepted as db 195 db 169
Oct 03 2018