#14 Parsing bug

closed-fixed
nobody
None
1
2007-02-28
2007-02-23
No

With the newest makepp build (CVS 2007-02-23) it fails silently if I have a construction like:

ifeq ($(TARGET_ARCH), Win64) and ifeq ($(HWTYPE), x64)
TEST := test
endif

No errors or warnings. It just doesn't enter the statement.

If I redo this into:

ifeq ($(TARGET_ARCH), Win64)
and ifeq ($(HWTYPE), x64)
TEST := test
endif

then it works fine.

If the first is a bug in my code then it should give a parser error or stop working instead of silently continuing.

-- Henrik

Discussion

  • Daniel Pfeiffer

    Daniel Pfeiffer - 2007-02-27
    • priority: 5 --> 1
    • status: open --> open-postponed
     
  • Daniel Pfeiffer

    Daniel Pfeiffer - 2007-02-27

    Logged In: YES
    user_id=189473
    Originator: NO

    What happens here is that it compares "$(TARGET_ARCH)" with "Win64) and ifeq ($(HWTYPE), x64", which is of course not equal. It should trip over the non-nesting parens, but that's not trivial to do (not really hard, but requires quite a bit of code, since nothing else in make cares about lonely parens -- i.e. not after a $ -- matching). You are right that we could try to catch this, but there are so many strange variants that are right, that it doesn't seem worthwhile to write a full blown parser for the strangeness of this one statement. Currently I'm only adding an error if the line doesn't end with ')'.

    N.B.: We have inherited from GNU make a horrible range of possible ifeq syntaxes, with embedded parens within the paren variant, additional commas being part of the second string and a missing comma without parens meaning the separator is a space, or if there is none, the second arg is empty.

     
  • Daniel Pfeiffer

    Daniel Pfeiffer - 2007-02-28

    Logged In: YES
    user_id=189473
    Originator: NO

    Instead of implementing a parser for this statement, which would catch only those few odd uses, which GNU make doesn't support, we now log the strings makepp thinks it is comparing, so you can debug this.

     
  • Daniel Pfeiffer

    Daniel Pfeiffer - 2007-02-28
    • status: open-postponed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks