Skip to content

Using api.prefix{ ... } breaks yyerror() #90

Open
@Hinderk

Description

@Hinderk

A #define directive in the .tab.cpp file will replace yyerror with - for example - YBerror. However, a token named YBerror has been introduced already in the .tab.hpp file in the enumeration YBtokentype with the value 255. Under Linux this token will not be generated. Hence, there is no conflict in the Linux case. If no API prefix is used, the token features the name "YYerror". The #define will not be present and there is no conflict with the yyerror function thanks to case sensitivity.

There is a workaround which consists in undefining yyerror at the proper moment. In certain applications this will work. In other cases linker issues will arise as each parser creates the same yyerror symbol. The attached example illustrates the problem.

API Prefix Problem.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions