Menu

#276 preprocessor do not handle commented `ifdef properly

v0.8
closed-fixed
nobody
5
2007-10-25
2007-07-23
Anonymous
No

Hi,

Icarus Verilog appears not handling commented out `ifdef/`else/`endif properly, see examples below.

The bug still exists in the latest development verions.

$ iverilog -E test.v
test.v:7: warning: macro `endif undefined (and assumed null) at this point.

The output (a.out) incorrectly contains "*/"

// -------- file: test.v --------
`ifdef A

/*
`endif
*/

`endif

// -------- end of file: test.v --------

Discussion

  • Cary R.

    Cary R. - 2007-08-24

    Logged In: YES
    user_id=1651735
    Originator: NO

    This patch is for the development version, but it should be trivial to adapt it to also work with 0.8.5. The problem is/was that C style comment are not recognized/processed in a false/suppressed block. FYI new style comments (//) do work correctly.
    File Added: 0001-Make-C-style-comments-work-in-false-suppressed-ifdef.patch

     
  • Cary R.

    Cary R. - 2007-09-17

    Logged In: YES
    user_id=1651735
    Originator: NO

    FYI this patch will also apply to the stable version with line offset warnings.

     
  • Cary R.

    Cary R. - 2007-10-25

    Logged In: YES
    user_id=1651735
    Originator: NO

    The attached v0_8 patch will apply directly to the stable version (no warnings).
    File Added: 0001-v0_8-make-C-style-comments-work-in-false-suppressed.patch

     
  • Cary R.

    Cary R. - 2007-10-25
    • status: open --> closed-fixed
     

Log in to post a comment.