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

-Wundef should be added to the build to catch #if references to undefined macros

XMLWordPrintable

    • b23

        There are now many uses of #if INCLUDE_XXX in the sources to allow the minimal VM to exclude certain features and functionality. In order for this to work properly, all source files with INCLUDE_XXX references need to include macros.hpp. If they don't, "#if INCLUDE_XXX" will always include the feature, even if we are doing a minimal VM build.

        There is no mechanism in place to guarantee that macros.hpp has been properly included. Adding -Wundef would result in compiler errors for cases where #if INCLUDE_XXX is used and INCLUDE_XXX is not defined. Note that we already build with -Werror, which is why -Wundef will result in errors instead of warnings (and errors are what we want in this case).

        Note that JDK-8006498 is currently preventing us from using -Wundef. There are some uses of "#if ASSERTS" that need to be changed to "#ifdef ASSERT". This bug will need to be fixed first.

              jprovino Joseph Provino (Inactive)
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: