[Issue 13512] dmd cannot compile perfectly valid code with shebang

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 21 07:49:44 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13512

--- Comment #7 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
(In reply to Sobirari Muhomori from comment #6)
> AFAIK, the standard text encoding on posix today is utf-8
oh, and for what reason we have that strange "locale settings" then? also, can
you point me at the exact standard part which tells that text encoding is utf-8
regardless to current locale settings? or the part that tells anything about
text encoding for that matter.

and no, GNU/Linux is *not* The New Standard Maker.

> Shebang is sort of brittle by design. It works only for text files
WUT?! O_O it works perfectly for *any* type of file. it's completely ok to
place binary data after shebang if interpreter can cope with that.

> and if the text file encoding matches that of your system.
and the given example matches. yet dmd refuses to compile my sample. not *run*,
but *compile*.

the right shebang support in dmd must be like this: check if the first chars of
the file forms shebang, and if they are, then just skipping other chars until
'\n'. and skip '\n'. that's all. no validation. no martian logic. just skipping
chars.

--


More information about the Digitalmars-d-bugs mailing list