digitalmars.D.bugs - [Issue 1276] New: static assert message displayed with escaped characters
- d-bugmail puremagic.com (33/33) Jun 18 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1276
- d-bugmail puremagic.com (11/11) Jun 19 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1276
- d-bugmail puremagic.com (5/5) Jun 19 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1276
- d-bugmail puremagic.com (9/9) Jun 26 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1276
http://d.puremagic.com/issues/show_bug.cgi?id=1276 Summary: static assert message displayed with escaped characters Product: D Version: 1.015 Platform: PC OS/Version: Windows Status: NEW Keywords: diagnostic Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: smjg iname.com If I try to make a static assert message span multiple lines, it doesn't work. This is because it tries to display it as a string in code, and in the process turns certain characters into their escape sequences. ---------- static assert (false, "An error message \tthat spans multiple lines, and also contains such characters as a tab, \\ and \"."); ---------- static_assert_linebreaks.d(1): static assert "An error message\x0a\x09that spans multiple lines, and also contains such characters as a tab,\x0a\\' and \"." ---------- Since the purpose of this is to display a message while running the compiler, it should just display the string, rather than a code representation of it. That is, the compiler output should look something like this: static_assert_linebreaks.d(1): static assert is false: An error message that spans multiple lines, and also contains such characters as a tab, \ and ". --
Jun 18 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1276 ------- Comment #1 from davidl 126.com 2007-06-19 06:15 ------- Oh, u need to define valid escape sequence usable in that static assert specifically consider: static assert(false, "%s"); what supposed to be happen? surely not segfault or arbitrary strings. so only \ leading ones need to be taken care of specially. while this complicates the compiler. I doubt if walter would love to implement it in the near future :) --
Jun 19 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1276 ------- Comment #2 from smjg iname.com 2007-06-19 06:31 ------- There is no escape sequence in the string "%s". There are just two characters - '%' and 's'. --
Jun 19 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1276 onlystupidspamhere yahoo.se changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #3 from onlystupidspamhere yahoo.se 2007-06-26 14:29 ------- Fixed in 1.017. --
Jun 26 2007