[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: compiler warnings in 5.1
- From: David Burgess <dburgess@...>
- Date: Fri, 23 Dec 2005 01:23:34 +1100
Not much help here.
On 12/23/05, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> > If the target is to remove compiler warnings -
>
> As much as we can :)
>
>
> > lgc.c(121) : warning C4244: '=' : conversion from 'int ' to 'unsigned
> > char ', possible loss of data
>
> The compiler could be smarter here :( The 'int' expression is in
> the form ((a & b) | c), where a and c are chars and b is a small
> constant. It is not difficult to infer that the result fits in a char.
You are correct. VC annoyingly sees unpostixed constants as int.
I cant get rid of the diagnostic. Anyone else got any ideas?
>
>
> > lstring.c(82) : warning C4709: comma operator within array index expression
>
> What is wrong with a comma operator in an index? (Maybe someone may
> think it is a matrix access, like a[i,j]?
Yes. MS doco
"An array index legally may be the value of the last expression in a
series of expressions separated by the comma operator. However, the
intent may have been to use the expressions to specify multiple
indexes into a multidimensional array."
> Then extra parentheses should
> stop the warning, but they do not.) Is there anything we can do about
> that warning?
I experimented and it beats me as well.
>
>
> > liolib.c(198) : warning C4090: '=' : different 'const' qualifiers
My patch, sorry.
>
>
> > loslib.c(211) : warning C4702: unreachable code
>
> I know no solution to this case. If we put the return, VC complains. If
> we remove it, other compilers complain.
I cant think of a solution either.
David B