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

Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas

XMLWordPrintable

    • b15

        Change 8037816 introduced extra format checking by GCC for custom HS printf functions by annotating them with __attribute__((format(printf,...)). These checks have been selectively disabled with the help of diagnostic pragmas (i.e. #pragma GCC diagnostic ignored "-Wformat-nonliteral") in places where these functions are called with non-constant format strings.

        Unfortunately, diagnostic pragmas were only introduced in GCC 4.2 (see http://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas). Older GCC versions simply ignore these pragmas and issue a warning.

        The fix to this problem is trivial - only enable '__attribute__((format(printf,...))'-annotations for GCC 4.2 and above.

              simonis Volker Simonis
              simonis Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: