RFR 8056039: Hotspot does not compile with clang 3.4 on Linux

Christian Thalinger christian.thalinger at oracle.com
Thu Aug 28 18:21:58 UTC 2014


On Aug 28, 2014, at 3:46 AM, Mikael Gerdin <mikael.gerdin at oracle.com> wrote:

> Christian,
> 
> On 08/27/2014 07:00 PM, Christian Thalinger wrote:
>> 
>> On Aug 27, 2014, at 9:59 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>> 
>>> On 27/08/14 17:57, Christian Thalinger wrote:
>>>> Maybe you want to fix this one too:
>>>> 
>>>> [#JDK-8025688] Clang: enable return type warnings on Linux - Java Bug System
>>>> https://bugs.openjdk.java.net/browse/JDK-8025688
>>> 
>>> I've created a prototype to make sure ShouldNotReachHere(), and friends, never return. With that in place we only need a few small changes and then we can enable -Wreturn-type on Linux. The prototype uses __attribute__((noreturn)).
>> 
>> Great, thanks!
> 
> Since Stefan has already put some effort into 8025688, are you ok with fixing that as a separate issue?

Sure.

> -Wreturn-type is not specific to clang AFAIK, it's available in (and should be enabled with ) gcc as well.
> 
> /Mikael
> 
>> 
>>> 
>>> thanks,
>>> StefanK
>>> 
>>> 
>>>> 
>>>> On Aug 26, 2014, at 3:17 AM, Mikael Gerdin <mikael.gerdin at oracle.com> wrote:
>>>> 
>>>>> Hi all,
>>>>> 
>>>>> In order to get clang's (sometimes) more helpful error messages when compiling
>>>>> I'd like to fix the few remaining places where clang fails to compile Hotspot.
>>>>> 
>>>>> The culprit in this case was "local_vsnprintf" in os_linux.cpp, an unused
>>>>> function which wasn't annotaded with the PRINTF_FORMAT macro.
>>>>> Since the function was unused I decided to remove it instead, then I found it
>>>>> in the other os_*nix.cpp files as well.
>>>>> 
>>>>> Digging into the Teamware history it looks like it first appeared in the
>>>>> Solaris port because vsnprintf did not exist on some very old versions of
>>>>> Solaris, so it was dynamically looked up through dlsym. For a few years
>>>>> vsnprintf has been present in the Solaris header files, so I think it's safe
>>>>> to remove the workaround now some 17 years later.
>>>>> 
>>>>> I also need a SCANF_FORMAT for an internal file, so I added that to
>>>>> globalDefinitions.
>>>>> 
>>>>> Webrev: http://cr.openjdk.java.net/~mgerdin/8056039/webrev/
>>>>> Buglink: https://bugs.openjdk.java.net/browse/JDK-8056039
>>>>> 
>>>>> Thanks
>>>>> /Mikael
>>>>> 
>>>>> 
>>> 
>> 
> 



More information about the hotspot-dev mailing list