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

Shenandoah: rich asserts trigger "empty statement" inspection

XMLWordPrintable

    • gc
    • b24

        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.

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

                Created:
                Updated:
                Resolved: