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

Improve local control of compiler warnings

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 13
    • 13
    • hotspot
    • b07
    • generic
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: