gcc - Ignore invalid directives in cpp -
gcc - Ignore invalid directives in cpp -
we had been using directives in our code invalid in today's standards. eg. #comment1
this used work in old version of gcc (2.x). i'm trying move off new gcc (4.x) i'm getting errors such : "error: invalid preprocessing directive #comment1"
easy prepare alter # // in directives, cannot due other dependencies.
question is, there way tell cpp ignore these invalid directives ?
however should interpret valid directives should eg #ifndef #define etc
thank you!
you didn't why
cannot alter # // in directives
i guess have tools or scripts depending on them. should update these follow current standard.
maybe more unique or improbable suffix might help you, eg utilize //#comment
instead of #comment
but essentially, asking more or less standard conforming compiler understand non-standard , deprecated language feature, , hopeless.
alternatively, patch recent gcc source code (e.g. gcc 4.6 one) follow requirements, don't think thought (and plugin ability of gcc 4.6 don't help here, since there no plugin hooks in preprocessor).
my advice still alter source code more conformant current standards. never time loss so.
gcc
Comments
Post a Comment