<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>The Visual C++ compiler outputs source file name as they are compiled:<BR>
<BR>D:\dev2\cm3\m3-libs\m3core>cl -nologo -c nul.c<BR>nul.c<BR>
 <BR>
D:\dev2\cm3\m3-libs\m3core>cl -nologo -c nul.c<BR>nul.c<BR>
 <BR>
D:\dev2\cm3\m3-libs\m3core>cl -nologo -c nul.c nul.c<BR>nul.c<BR>nul.c<BR>Generating Code...<BR>
<BR>I believe that suppressing this will suppress all other warning/error output.<BR>
<BR>See, they both go to stdout:<BR>
<BR>D:\dev2\cm3\m3-libs\m3core>echo error > foo.c<BR>
D:\dev2\cm3\m3-libs\m3core>cl -nologo -c foo.c<BR>foo.c<BR>foo.c(2) : fatal error C1004: unexpected end-of-file found<BR>
 <BR>
D:\dev2\cm3\m3-libs\m3core>cl -nologo -c foo.c >nul<BR>
 <BR>
D:\dev2\cm3\m3-libs\m3core>cl -nologo -c foo.<FONT face="">c</FONT> 2>nul<BR>foo.<FONT face="">c</FONT><BR>foo.<FONT face="">c</FONT>(2) : fatal error C1004: unexpected end-of-file found<BR>
 <BR>
I tried something annoyingly expensive like<BR>cl -nologo -c foo.c | findstr /v /b /e foo.c <BR>
 <BR>
which would only include lines that don't begin and end foo.c, but in normal<BR>use, there are no such lines, there is just the one line, and so findstr fails, and so the overall command fails, not good.<BR>
 <BR>
You could do this:<BR>
 (echo. && cl -nologo -c foo.c)  | findstr /v /b /e foo.c <BR>
Which nets you just a blank line output, but this seems to be heading to deep end, and even that blank line shouldn't be there.<BR>
<BR>Suggestions?<BR>
<BR>Maybe a change in cm3? Moving compile_c into it?<BR>My idea of moving Quake code into cm3 would be that cm3 has a definition of compile_c,<BR>but that if the user supplies compile_c, use that instead.<BR>
<BR>Doing that to solve just this is overkill, but it's not a bad idea anyway.<BR>
<BR>Smaller ideas could be considered, including:<BR>
<BR>1) Have all the compile_c implementations echo the source file, so they'd all have the same output<BR>While is this is noisy in the user experience, there isn't much C.<BR>It does pollute all the platforms to cover up a small NT-specific problem.<BR>
<BR>2) What I suggested before, allow but to not encourage test cases to have per-platform results.<BR>This particular problem only affects test cases with C code, which is rare.<BR>There is one.<BR>
This would be very easy and solve the problem well.<BR>
It shouldn't be encouraged though, as it makes it more difficult to change the expected output of a test.<BR>
<BR>3) Currently if M3TESTS is defined, NT386.common redirects all C compiler output to nul.<BR>Good enough?<BR>
<BR>Related, in usage of GNU libtool, files are often compiled twice, once PIC, once not.<BR>The way it works, one invocation is directed to /dev/null, one is not.<BR>This would kinda sorta seem to set a precedent for redirecting C compiler output to /dev/null,<BR>except that they do run it both ways. It's not that errors are lost, just that they aren't doubled.<BR>
<BR>Also related, again, I suggest a log file.<BR>A detail hilighted here is that in fact ALL command would go to the log, and NONE would likely<BR>go to stdout/stderr. Stdout/stderr would be strictly the domain of cm3.<BR>Perhaps cm3 could "sniff" for errors and pass them along, perhaps.<BR>
 <BR>
 <BR>
You know, really, the log file approach is already what is used for linking.<BR>
Why just linking? Why not everything run in the directory?<BR>
Ah, it looks like that isn't for all platforms though, just NT386.<BR>
 <BR>
I am half just making trouble here.<BR>
I think the logging should be more verbose, but even making it quiet is surprisingly difficult.<BR>
I guess the linking example shows the way though, I should just redirect C compiler output always to a file.<BR>
Maybe the same file as linking uses, maybe not.<BR>
The user experience in the face of error is, initially, badly degraded.<BR>
However there are ways to mitigate.<BR>
First, as with linking, upon error, we can tell the user about the file.<BR>
Second, upon error, we could just echo the file's contents to stdout.<BR>
It's just that for success, saying less is better.<BR>
 <BR>
I'll do that -- redirect to a file.<BR>
 <BR>
 - Jay<BR></body>
</html>