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

Enable -Wpedantic on clang

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • tbd
    • 23
    • infrastructure

      Inspired by (the later backed-out) JDK-8296115, I propose to enable -Wpedantic for clang. This has already found some irregularities in the code, like mistakenly using `#import` instead of `#include`. In this patch, I disable warnings for these individual buggy or badly written files, but I intend to post follow-up issues on the respective teams to have them properly fixed.

      Unfortunately, it is not possible to enable -Wpedantic on gcc, since individual warnings in -Wpedantic cannot be disabled. This means that code like this:

      #define DEBUG_ONLY(code) code;

      DEBUG_ONLY(foo());

      will result in a `; ;`. This breaks the C standard, but is benign, and we use it all over the place. On clang, we can ignore this by -Wno-extra-semi, but this is not available on gcc.

            ihse Magnus Ihse Bursie
            ihse Magnus Ihse Bursie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: