clang + cygwin + -ferror-limit does not work when there are no errors

Hello,

I was building and notices something strange. When build errors
occurrs all works fine but when no errors are present, the flag is
passed to gcc. Same thing happens with the -fcolor-diagnostic flag.

Two odd things here:

1. Why is the flag passed on to gcc?
2. Why is gcc being used at all?

Console output:

    uidw8099@FRL2T93G ~/playground/SM_Test/build master $clang -Werror
-pedantic -xc -c -MD -MF int_sm.o.dep -std=c99 -ferror-limit=10
../int_Yes_StateMachine.c -o int_sm.o
    (errors properly printed)
    2 errors generated.

    uidw8099@FRL2T93G ~/playground/SM_Test/build master $clang -Werror
-pedantic -xc -c -MD -MF int_sm.o.dep -std=c99 -ferror-limit=10
../int_Yes_StateMachine.c -o int_sm.o
    gcc: error: unrecognized command line option ‘-ferror-limit=10’
    clang: error: assembler (via gcc) command failed with exit code 1
(use -v to see invocation)

What is going on here?

Thank you.

First, it would be nice if Clang used the integrated assembler on Cygwin by default. I don’t recall why it is disabled by default. Try passing -integrated-as to clang to get this behavior locally.

I believe GCC is being used because finding an appropriate ‘as’ to run (it could be triple prefixed) is hard.

-integrated-as worked for compiling. Is there a similar switch for the linker?

And how do i get clang to output ALL of its known options? clang++
--help does not output -integrated-as as one of the possible
arguments.