Skip to content

Commit

Permalink
Eliminate warnings about #warning (#122)
Browse files Browse the repository at this point in the history
The warnings are already only emitted with GCC so changing them to the
GCC diagnostic pragma is safe.
  • Loading branch information
jbowler authored and mrbean-bremen committed Nov 2, 2023
1 parent d11fc4f commit b454669
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion generator/parser/declarator_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void DeclaratorCompiler::visitPtrOperator(PtrOperatorAST *node)
if (node->mem_ptr)
{
#if defined(__GNUC__)
#warning "ptr to mem -- not implemented"
#pragma GCC warning "ptr to mem -- not implemented"
#endif
}
}
Expand Down
4 changes: 2 additions & 2 deletions generator/parser/name_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void NameCompiler::visitUnqualifiedName(UnqualifiedNameAST *node)
if (OperatorFunctionIdAST *op_id = node->operator_id)
{
#if defined(__GNUC__)
#warning "NameCompiler::visitUnqualifiedName() -- implement me"
#pragma GCC warning "NameCompiler::visitUnqualifiedName() -- implement me"
#endif

if (op_id->op && op_id->op->op)
Expand All @@ -93,7 +93,7 @@ void NameCompiler::visitUnqualifiedName(UnqualifiedNameAST *node)
else if (op_id->type_specifier)
{
#if defined(__GNUC__)
#warning "don't use an hardcoded string as cast' name"
#pragma GCC warning "don't use an hardcoded string as cast' name"
#endif
Token const &tk = _M_token_stream->token ((int) op_id->start_token);
Token const &end_tk = _M_token_stream->token ((int) op_id->end_token);
Expand Down
16 changes: 8 additions & 8 deletions generator/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ bool Parser::parseAsmDefinition(DeclarationAST *&node)
parseCvQualify(cv);

#if defined(__GNUC__)
#warning "implement me"
#pragma GCC warning "implement me"
#endif
skip('(', ')');
token_stream.nextToken();
Expand Down Expand Up @@ -2427,7 +2427,7 @@ bool Parser::parseInitializerClause(InitializerClauseAST *&node)
if (token_stream.lookAhead() == '{')
{
#if defined(__GNUC__)
#warning "implement me"
#pragma GCC warning "implement me"
#endif
if (skip('{','}'))
token_stream.nextToken();
Expand All @@ -2451,7 +2451,7 @@ bool Parser::parseInitializerClause(InitializerClauseAST *&node)
bool Parser::parsePtrToMember(PtrToMemberAST *&node)
{
#if defined(__GNUC__)
#warning "implemente me (AST)"
#pragma GCC warning "implemente me (AST)"
#endif

std::size_t start = token_stream.cursor();
Expand Down Expand Up @@ -2625,15 +2625,15 @@ bool Parser::parseStatement(StatementAST *&node)
case Token_break:
case Token_continue:
#if defined(__GNUC__)
#warning "implement me"
#pragma GCC warning "implement me"
#endif
token_stream.nextToken();
ADVANCE(';', ";");
return true;

case Token_goto:
#if defined(__GNUC__)
#warning "implement me"
#pragma GCC warning "implement me"
#endif
token_stream.nextToken();
ADVANCE(Token_identifier, "identifier");
Expand Down Expand Up @@ -3279,7 +3279,7 @@ bool Parser::parseDeclarationInternal(DeclarationAST *&node)
ADVANCE(';', ";");

#if defined(__GNUC__)
#warning "mark the ast as constant"
#pragma GCC warning "mark the ast as constant"
#endif
SimpleDeclarationAST *ast = CreateNode<SimpleDeclarationAST>(_M_pool);
ast->init_declarators = declarators;
Expand Down Expand Up @@ -3380,7 +3380,7 @@ bool Parser::parseDeclarationInternal(DeclarationAST *&node)
bool Parser::skipFunctionBody(StatementAST *&)
{
#if defined(__GNUC__)
#warning "Parser::skipFunctionBody() -- implement me"
#pragma GCC warning "Parser::skipFunctionBody() -- implement me"
#endif
Q_ASSERT(0); // ### not implemented
return 0;
Expand Down Expand Up @@ -3409,7 +3409,7 @@ bool Parser::parseTypeSpecifierOrClassSpec(TypeSpecifierAST *&node)
bool Parser::parseTryBlockStatement(StatementAST *&node)
{
#if defined(__GNUC__)
#warning "implement me"
#pragma GCC warning "implement me"
#endif
CHECK(Token_try);

Expand Down

0 comments on commit b454669

Please sign in to comment.