#define issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hgirma
    New Member
    • Sep 2006
    • 1

    #1

    #define issue

    i am compling a lib on AIX 5.2 using GNU complier and i get the following error:

    "lexer.l", line 82.1: 1506-045 (S) Undeclared identifier cfg.

    cfg is defined by #define:
    #define YY_DECL int cfg_yylex YY_PROTO(( cfg_t *cfg ))

    how does this define work?

    it 's error when cf is referenced:
    [B]cfg->line++;[/B]
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    #define YY_DECL int cfg_yylex YY_PROTO(( cfg_t *cfg ))

    does not define cfg, it defines YY_DECL

    If you do not use YY_DECL then cfg will not be defined. Even if you do use YY_DECL cfg will only be defined in specific circumstances.

    We will need to see the code using cfg and and code that uses YY_DECL to be able to fully answer the question.

    Comment

    Working...