[cfe-dev] cindex example produces a warning

bruce.r.stephens at gmail.com bruce.r.stephens at gmail.com
Thu Feb 3 02:05:02 PST 2011

Sebastian Redl <sebastian.redl-Qcow1E72b/EoPbFrRiQr9Q at public.gmane.org>

> On 02.02.2011 22:53, bruce.r.stephens-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org wrote:
>> The following (taken from slides on libclang) produces a warning when
>> run on a file:
>> warning: ./syntax-checker: 'linker' input unused when '-fsyntax-only' is present
>> Is that expected?
>> #include "Index.h"
>> int main(int argc, const char *const argv[]) {
>>    CXIndex Index = clang_createIndex(0, 0);
>>    CXTranslationUnit TU = clang_parseTranslationUnit(Index, 0,
>>                                argv, argc, 0, 0, CXTranslationUnit_None);
> Here, the arguments to the example program are simply passed on to 
> Clang, except that -fsyntax-only is added. So the question is, how do 
> you call the example program?

Just with a source file (and -I arguments, if necessary).  So,
"./syntax-checker hello.c", for example.  Adding -c produces another
   warning: argument unused during compilation: '-c'

More information about the cfe-dev mailing list