cindex example produces a warning

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);
  for (unsigned I = 0, N = clang_getNumDiagnostics(TU); I != N; ++I) {
    CXDiagnostic Diag = clang_getDiagnostic(TU, I);
    CXString String = clang_formatDiagnostic(Diag,
    fprintf(stderr, "%s\n", clang_getCString(String));
  return 0;

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?


Sebastian Redl <sebastian.redl-Qcow1E72b/>