-emit-html ignored


i am trying to produce an html file with the source code of test.c, however i am getting the following

$ clang test.c -emit-html -o test.html
clang: warning: argument unused during compilation: '-emit-html'

resulting in test.html to be the compiled executable of test.c

Thank you in advance

You'll want to add at least -c to that command line to tell it that you're not trying to do a full build.


I believe you need the first argument to be -cc1

At least that worked for me.

Yes, that did the trick :slight_smile:

Is there any way it could search my C_INCLUDE_PATH instead of having to pass all the paths with -I?

Thank you

This works:

clang test.c -fsyntax-only -Xclang -emit-html -o test.html

The -Xclang flag causes the next flag to be passed directly to the actual compiler call (-cc1). We don't advertise it because those options are not guaranteed to be stable, so anyone writing scripts depending on -Xclang or -cc1 should be prepared to deal with breakage when they update their Clang. (At least, that's my understanding.)


P.S. I didn't know about -emit-html...cool!