When using gcc or g++, what is the difference between telling GCC to only compile a file and not link (-S), combined with telling it to not produce an output file (-o "nul"):
gcc.exe/g++.exe -S "filename" -o "nul"
... and telling it to check syntax only (-fsyntax-only)?
gcc.exe/g++.exe -c "filename" -fsyntax-only
Both options do not produce output, only run the compilation stage, and take about the same amount of time to run.
I am using the Windows ports of GCC, which treats "nul" as the null device that eats all output (like /dev/null).
Edit: as Mike Seymour pointed out, when passing -fsyntax-only to GCC, it will not attempt to perform optimization even if it is told to do so, which is not the case for -S. In other words this is slower (I've performed the measurements):
gcc.exe -S "filename" -o "nul" -O3
... than this:
gcc.exe -c "filename" -fsyntax-only -O3