Menu

#1023 Leading underscore in number no longer allowed

devel
closed-invalid
nobody
None
5
2017-09-09
2017-09-09
No

These two lines used to compile recently.

CVFPADDER10_A0 = 64'h3ff199999999_999a;

CVFPADDER12_A1 = 64'h_8000_0000_0000_0000;

But unless I am mistaken, the latest source shot verilog-10.2.tar.gz
no longer accepts the latter one, with the underscore as the first digit.

Discussion

  • David J Greaves

    David J Greaves - 2017-09-09

    The IEEE standard say "The underscore character () shall be legal anywhere in a number except as the first character. The underscore character is ignored" but elsewhere I see this is transcribed as "The underscore character () shall be legal anywhere in a number except as the first character where the underscore character is ignored." which is perhaps the case in point. Also, it isperhaps a matter of interpretation of the standard as to whether the size prefix counts as 'anywhere in a number' or not!

     
  • Martin Whitaker

    Martin Whitaker - 2017-09-09
    • status: open --> closed-invalid
     
  • Martin Whitaker

    Martin Whitaker - 2017-09-09

    Agreed, the text you quote could be interpreted either way, but the formal syntax definition in Annex A makes it clear - your second example is not legal syntax.

    The change was not made to rigourously enforce the standard - it was to fix a compiler crash in another case of illegal syntax.

    P.S. To maintain readability, you can replace the leading underscore with a space.

     

Log in to post a comment.

MongoDB Logo MongoDB