Browse Source

CppParser: fix compilation warnings

Fix the compilation warnings with gcc:

../../../src/CppParser/Parser.cpp: In member function ‘CppSharp::CppParser::AST::DeclarationContext*
 CppSharp::CppParser::Parser::GetNamespace(clang::Decl*, clang::DeclContext*)’:
../../../src/CppParser/Parser.cpp:1119:68: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘llvm::StringRef’ [-Wformat=]
             printf("Unhandled declaration context kind: %s\n", Kind);
                                                                    ^
../../../src/CppParser/Parser.cpp: In member function ‘CppSharp::CppParser::AST::Declaration* CppSharp::CppParser::Parser::WalkDeclaration(clang::Decl*, bool, bool)’:
../../../src/CppParser/Parser.cpp:2430:51: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘llvm::StringRef’ [-Wformat=]
         Debug("  %s (line %u)\n", FileName, LineNo);
                                                   ^

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
pull/247/head
Tomi Valkeinen 11 years ago
parent
commit
16ccc38221
  1. 4
      src/CppParser/Parser.cpp

4
src/CppParser/Parser.cpp

@ -1126,7 +1126,7 @@ DeclarationContext* Parser::GetNamespace(clang::Decl* D, @@ -1126,7 +1126,7 @@ DeclarationContext* Parser::GetNamespace(clang::Decl* D,
default:
{
StringRef Kind = Ctx->getDeclKindName();
printf("Unhandled declaration context kind: %s\n", Kind);
printf("Unhandled declaration context kind: %s\n", Kind.str().c_str());
assert(0 && "Unhandled declaration context kind");
} }
}
@ -2456,7 +2456,7 @@ Declaration* Parser::WalkDeclaration(clang::Decl* D, @@ -2456,7 +2456,7 @@ Declaration* Parser::WalkDeclaration(clang::Decl* D,
auto FileName = SM.getFilename(Loc);
auto Offset = SM.getFileOffset(Loc);
auto LineNo = SM.getLineNumber(SM.getFileID(Loc), Offset);
Debug(" %s (line %u)\n", FileName, LineNo);
Debug(" %s (line %u)\n", FileName.str().c_str(), LineNo);
break;
} };

Loading…
Cancel
Save