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

Improve local control of compiler warnings

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b07
    • CPU:
      generic
    • OS:
      generic

      Description

      HotSpot already has PRAGMA_DIAG_PUSH/POP macro pair. However, they only have non-empty expansions for gcc/clang. Visual Studio has long supported a similar mechanism, and these macros should be implemented there too.

      Even with the PUSH/POP pair though, it's often clumsy to locally disable a warning, since the syntax for doing so is so compiler-specific. This leads to #ifdef checking to determine whether the relevant compiler is being used at each site.

      Since the warnings to be suppressed are themselves compiler-specific, this situation could be improved by providing compiler-specific macros to disable warnings. If not using that compiler, the macros would have empty expansions.

        Attachments

          Activity

            People

            Assignee:
            kbarrett Kim Barrett
            Reporter:
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: