Description of fix
aph at redhat.com
Wed May 11 01:44:08 PDT 2011
On 11/05/11 09:22, Andrew Haley wrote:
> On 10/05/11 19:07, Christos Zoulas wrote:
>> On May 10, 6:09pm, aph at redhat.com (Andrew Haley) wrote:
>> -- Subject: Re: Description of fix
>> | On 05/10/2011 06:00 PM, Azeem Jiva wrote:
>> | > Sorry forgot to add that if I try to build a 64bit JVM under Ubuntu
>> | > 11.04 with GCC 4.5.2 I get the following compile time error:
>> | >
>> | > /home/azeem/hs/hotspot/src/os/linux/vm/os_linux.cpp: In static member
>> | > function ‘static bool os::Linux::hugetlbfs_sanity_check(bool, size_t)’:
>> | > /home/azeem/hs/hotspot/src/os/linux/vm/os_linux.cpp:2853:43: error: use
>> | > of assignment suppression and length modifier together in gnu_scanf format
>> | >
>> | >
>> | > The fix is to remove the length modifier.
>> | That shouldn't be an error, though: it's perfectly correct code.
>> | I suppose it's a (rather unhelpful) warning that's erroring out
>> | because of -Werror.
>> The length specifier does not affect the scanning process (i.e.
>> the scanner does not stop on overflow, it consumes the whole numeric
>> string) so the length modifier is superfluous on skipped format
>> specifiers. Perhaps it is better for portability to remove the
>> length modifier and call it a day.
> Maybe, but I'd like to try to get to the bottom of this. If
> it's a gcc bug I'll fix it in gcc. I'm a gcc developer too.
It looks like this has been a warning in gcc since forever. I have no
idea why it generates an error on Debian, though. So, I guess there's
no more to be done, but I don't like mysteries like this: they tend to
come back to bite you.
More information about the hotspot-compiler-dev