Bug 3940 – altsep not found

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-03-12T13:38:00Z
Last change time
2015-06-09T01:27:40Z
Assigned to
andrei
Creator
ellery-newcomer

Comments

Comment #0 by ellery-newcomer — 2010-03-12T13:38:41Z
import std.stdio; import std.path; void main(){ writeln(altsep == ""); } causes linker errors: test.o: In function `_Dmain': test.d:(.text._Dmain+0x17): undefined reference to `_D3std4path6altsepyG0a' collect2: ld returned 1 exit status --- errorlevel 1 perhaps sep, altsep, et al should be redefined as dynamic array types?
Comment #1 by bugzilla — 2010-03-12T23:23:17Z
There isn't an alternate separator on Linux, making a dummy one doesn't make much sense.
Comment #2 by ellery-newcomer — 2010-03-13T08:12:27Z
(In reply to comment #1) > There isn't an alternate separator on Linux, making a dummy one doesn't make > much sense. Then why does there pretend to be one? It's defined as static if(Posix){ immutable char[0] altsep; } Makes writing portable code more obnoxious. Perhaps an array of separators could be defined, e.g. static if(Windows){ immutable string[] seps = [sep, altsep]; } static if(Posix){ immutable string[] seps = [sep] } would express the fact a bit more cleanly
Comment #3 by andrej.mitrovich — 2011-05-26T14:09:18Z
They're now defined for both win & linux, but it's an empty string in linux, and "/" on windows. Marking this as fixed.