The compiler under DOS does not intercept all errors?
The compiler under DOS does not intercept all errors?
Hi ALL!
I compiled the source code here with a library written in C.
I noticed that the compiler displays only its own errors, and the linker itself displays errors related to the linker. That is, I cannot catch these errors using Open Pipe. Does the compiler under DOS not catch errors from other tools that it calls?
I compiled the source code here with a library written in C.
I noticed that the compiler displays only its own errors, and the linker itself displays errors related to the linker. That is, I cannot catch these errors using Open Pipe. Does the compiler under DOS not catch errors from other tools that it calls?
Re: The compiler under DOS does not intercept all errors?
Errors are probably on stderr, not just stdout. Maybe your piping setup doesn't catch stderr (error on dos iirc)
Re: The compiler under DOS does not intercept all errors?
No, you did not understand.
Here we take the usual source file:
Code: Select all
Const TEST_COMMAND = "fbc test.bas"
Open Pipe TEST_COMMAND For Input As #1
Dim As String ln
Do Until EOF(1)
Line Input #1, ln
Print ln
Loop
Close #1
Re: The compiler under DOS does not intercept all errors?
In DOS I tried:
only outputs compilation errors. All other errors are written to the console, not to the pipe
creates file $1 and writes there:
error 81: Invalid command-line option, "2"
On windows and linux the line "fbc test.bas 2>&1" works correctly.
Why doesn't it work in DOS?
Code: Select all
Open Pipe "fbc test.bas" For Input As #1
Code: Select all
Open Pipe "fbc test.bas 2>&1" For Input As #1
error 81: Invalid command-line option, "2"
On windows and linux the line "fbc test.bas 2>&1" works correctly.
Why doesn't it work in DOS?
Re: The compiler under DOS does not intercept all errors?
Did I understand correctly?
In DOS, programs can't receive another program's errors in their buffer? Errors are displayed only in the console?
And the second question: what is iirc ?
In DOS, programs can't receive another program's errors in their buffer? Errors are displayed only in the console?
And the second question: what is iirc ?
Re: The compiler under DOS does not intercept all errors?
Afaik it means that at least command.com doesn't support the piping syntax, but programs maybe can do it.
Common Fido/usenet/internet abbrevs.And the second question: what is iirc ?
IIRC= If I Recall Correctly
Afaik = As far as I know.
Last edited by marcov on Nov 13, 2022 14:20, edited 1 time in total.
Re: The compiler under DOS does not intercept all errors?
Thanks for answers!
Re: The compiler under DOS does not intercept all errors?
You could try the FreeDOS command replacement, FreeCom. It may support modern features like stderr piping.
Re: The compiler under DOS does not intercept all errors?
I'm in freedos and running. That is, by default, this is exactly the behavior as I described. I just thought that it was the compiler not redirecting errors, but it turned out that this is typical behavior in DOS