Re: help needed with gcc-4.4 build failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Julian Sikorski wrote:
> Hi,
> 
> I am trying to make gnome-chemistry-utils ready for the mass rebuild.
> Unfortunately, there are some issues which are beyond my skills. The
> first one is the fact that some adjustments for new xulrunner are
> needed. With gcc-4.4, however, build fails even earlier:
> 
> element.cc: In function 'void ReadValue(const char*, GcuValue&)':
> element.cc:49: error: invalid conversion from 'const char*' to 'char*'
> element.cc: In function 'void ReadDimensionalValue(const char*,
> GcuDimensionalValue&)':
> element.cc:58: error: invalid conversion from 'const char*' to 'char*'
> 
> Full build log is here:
> http://belegdol.fedorapeople.org/build.log
> 
> Upstream unfortunately cannot reproduce the problem, here is his comment:
> 
> 
> Looks like the issue comes with strchr.
> 
> man strchr says:
> char *strchr(const char *s, int c);
> 
> I don't see what is wrong since the argument is a const char* string.
> 
> I can't reproduce the issue. May be the signature of strchr changed in
> glibc?
> Anyway, the above signature is not consistent since it returns a char* which
> is a substring of a const char*.

I agree, that's not your fault.  It's what the standard says it has to be.

> If this is the case, there is a need for a test in configure to find which
> signature version is available.

I don't see why.  It looks to me like you can simply do this:

static void ReadDimensionalValue (char const *source, GcuDimensionalValue &value)
{
	const char *buf, *dot;
	char *tmp;
	value.value = strtod (source, &tmp);
	buf = tmp;
	dot = strchr (source, '.');
	value.prec = (dot)? buf - dot - 1: 0;
	value.delta = (*buf == '(')? strtol (buf + 1, NULL, 10): 0;
}

Slightly weird, but it'll do.

Andrew.

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux