Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8241062

Shenandoah: rich asserts trigger "empty statement" inspection

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b24

      Backports

        Description

        Asserts are defined like this:

        #define shenandoah_assert_correct(interior_loc, obj) \
                            ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__);

        ...and used like this:

          shenandoah_assert_correct(NULL, obj);

        So, after macro-expansion, we get ";;", which triggers static analysis tools (e.g. CLion). We should really do what the usual assert() macro does: drop the ";" in the macro definition.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kdnilsen Kelvin Nilsen
                  Reporter:
                  shade Aleksey Shipilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: