Bidirectional characters can cause security vulnerabilities, as explained in the paper mentioned in a comment in this patch. Therefore, we warn if such characters appear in string_literals, character_literals, or comments. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * scng.adb (Check_Bidi): New procedure to give warning. Note that this is called only for non-ASCII characters, so should not be an efficiency issue. (Slit): Call Check_Bidi for wide characters in string_literals. (Minus_Case): Call Check_Bidi for wide characters in comments. (Char_Literal_Case): Call Check_Bidi for wide characters in character_literals. Move Accumulate_Checksum down, because otherwise, if Err is True, the Code is uninitialized. * errout.ads: Make the obsolete nature of "Insertion character ?" more prominent; one should not have to read several paragraphs before finding out that it's obsolete.