RFR(XS): 8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue May 13 21:37:09 UTC 2014


Looks fine to me too.

Thanks,
Vladimir

On 5/13/14 1:59 PM, David Chase wrote:
> I'm not a Reviewer, but I've become rather familiar with this code recently,
> and your changes look entirely correct.
>
> And I will sponsor the fix as soon as we do get a Reviewer to comment.
>
> On 2014-05-13, at 3:32 PM, Volker Simonis <volker.simonis at gmail.com> wrote:
>
>> Hi,
>>
>> 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:
>>
>> http://cr.openjdk.java.net/~simonis/webrevs/8043029/
>> https://bugs.openjdk.java.net/browse/JDK-8043029
>>
>> Additionally to the before-mentioned fix, I have also improved the
>> version checking for the definition of the various diagnostic pragmas.
>> In the original version they would have only been enabled for
>> __GNUC_MINOR__ versions greater and equal '6' but nor for GCC 5.0 for
>> example. And I've also tried to break some of the overly long lines to
>> make them more readable.
>>
>> Thank you and best regards,
>> Volker
>>
>> PS: as always, I kindly ask for a sponsor to push the change once it
>> is reviewed :)
>


More information about the hotspot-dev mailing list