On 11/03/2017 01:26 AM, Gerald Pfeifer wrote:
Hi Nikolay and others,
the patch below avoids a warning of the kind
reader.c:276:20: warning: comparison of constant -1 with expression of type 'XmlReadState' (aka 'enum XmlReadState') is always false [-Wtautological-constant-out-of-range-compare] if (exp_broken == -1) ~~~~~~~~~~ ^ ~~
which clang issues, so I hope it can be included?
Gerald
Signed-off-by: Gerald Pfeifer gerald@pfeifer.com
dlls/xmllite/tests/reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c index 0f03c3b42e..2a93a76ddb 100644 --- a/dlls/xmllite/tests/reader.c +++ b/dlls/xmllite/tests/reader.c @@ -273,7 +273,7 @@ static void test_read_state(IXmlReader *reader, XmlReadState expected, state = -1; /* invalid state value */ IXmlReader_GetProperty(reader, XmlReaderProperty_ReadState, &state);
- if (exp_broken == -1)
- if (exp_broken == (XmlReadState)-1) broken_state = FALSE; else broken_state = broken(exp_broken == state);
Hi, Gerald.
Is this warning enabled by default in some release clang version? I'm not necessarily opposed in silencing it like that, but I imagine you'll see many more instances like that, and if it's not default set of warnings I don't know if we should bother.
On Sat, 4 Nov 2017, Nikolay Sivov wrote:
Is this warning enabled by default in some release clang version? I'm not necessarily opposed in silencing it like that, but I imagine you'll see many more instances like that, and if it's not default set of warnings I don't know if we should bother.
Yes, this happens with completely default clang as it is the system compiler on FreeBSD 10, reporting itself as clang 3.4.1.
Otherwise I would probably side with "let's not bother" as well (and usually use GCC to build Wine).
Gerald
On 11/05/2017 12:05 AM, Gerald Pfeifer wrote:
On Sat, 4 Nov 2017, Nikolay Sivov wrote:
Is this warning enabled by default in some release clang version? I'm not necessarily opposed in silencing it like that, but I imagine you'll see many more instances like that, and if it's not default set of warnings I don't know if we should bother.
Yes, this happens with completely default clang as it is the system compiler on FreeBSD 10, reporting itself as clang 3.4.1.
Otherwise I would probably side with "let's not bother" as well (and usually use GCC to build Wine).
I can reproduce with clang 3.8.1 on Debian, just sent a fix that does not use casting. Thanks for reporting.
Gerald
On Sun, 5 Nov 2017, Nikolay Sivov wrote:
I can reproduce with clang 3.8.1 on Debian, just sent a fix that does not use casting. Thanks for reporting.
Ah, cool. Thanks, Nikolay!
Looking at a build log with clang, I noticed a number of further issues and will try to submit some changes as time allows.
Gerald