Fix warnings occurring with gcc 4.3

David Holmes - Sun Microsystems David.Holmes at Sun.COM
Tue Feb 3 17:45:23 PST 2009


Xiaobin Lu said the following on 02/04/09 11:20:
> I think the right way to fix this is to define _lineno as "int" and fix 
> line 309 of vmError.cpp to use "%d" for _lineno instead of "SIZE_FORMAT" 
> (which is why I thought to use size_t for _lineno). 

I agree - revert to int and %d.

> It is strange I 
> didn't get error message for the above statement on 64 bit Linux.

I guess the compiler isn't that good at detecting problems with format 
specifiers. It also seems to have missed this at line 423:

  st->print(",  free space=%dk",
            ((intptr_t)fr.sp() - (intptr_t)stack_bottom) >> 10);

Cheers,
David

> -Xiaobin
>>
>> Cheers,
>> David Holmes
>>
>> Xiaobin Lu said the following on 02/04/09 09:56:
>>> On 02/03/09 15:12, Vladimir Kozlov wrote:
>>>> 6778669. Still in Dispatched state.
>>> The problem mentioned in Andrew's patch has actually been fixed 
>>> recently by Coleen and me. I don't have Redhat machine around, but I 
>>> can build hotspot successfully with latest fedora 10 release.
>>>
>>> -Xiaobin
>>>>
>>>> Vladimir
>>>>
>>>> Andrew John Hughes wrote:
>>>>> 2009/2/3 Xiaobin Lu <Xiaobin.Lu at sun.com>:
>>>>>> On 02/03/09 14:24, Andrew John Hughes wrote:
>>>>>>
>>>>>> 2009/2/3 Xiaobin Lu <Xiaobin.Lu at sun.com>:
>>>>>>
>>>>>>
>>>>>> Did you check out the latest code? Those you pointed out have been 
>>>>>> already
>>>>>> fixed.
>>>>>>
>>>>>> -Xiaobin
>>>>>>
>>>>>> On 02/03/09 12:30, Andrew John Hughes wrote:
>>>>>>
>>>>>>
>>>>>> A number of warnings are thrown when compiling the HotSpot code with
>>>>>> gcc 4.3, all of which are related to the incorrect use of printf
>>>>>> format specifiers.  As HotSpot is built with -Werror, these cause the
>>>>>> build to fail.  The attached patch against OpenJDK7 fixes them.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> They are not fixed in b45.
>>>>>>
>>>>>>
>>>>>> b45 is the latest promoted build. hg.openjdk.java.net/jdk7/hotspot 
>>>>>> should
>>>>>> have those what you are trying to fix. Those will show up in the next
>>>>>> promotion build.
>>>>>>
>>>>>> -Xiaobin
>>>>>>
>>>>>>
>>>>>
>>>>> Good. We obviously don't build directly from the forest and it isn't
>>>>> clear that such changes are in that tree; the commit list just shows
>>>>> the branch being tagged.
>>>
> 



More information about the hotspot-dev mailing list