Re: [Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-23 Thread Thiago Macieira
On Thursday, 23 March 2023 00:03:24 HST Hamish Moffatt via Interest wrote:
> OK. There's a similar issue in QtConcurrent (unchanged since 5.15
> actually) also driving me mad - __int64 resulting from std::distance is
> assigned to int.

In Qt 6, that should just be qsizetype or plain auto.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-23 Thread Hamish Moffatt via Interest

On 23/3/23 18:15, Thiago Macieira wrote:

On Wednesday, 22 March 2023 18:19:59 HST Hamish Moffatt via Interest wrote:

static constexpr quint8 tagBits =
QtPrivate::qConstexprCountTrailingZeroBits(alignment);

So would you fix it with a cast, or by changing the variable type to int
to match the function?

Either solution is fine. I was thinking of simply adding a quint8() cast around
the result, but changing to uint also works too. The latter is a smaller
change anyway.

OK. There's a similar issue in QtConcurrent (unchanged since 5.15 
actually) also driving me mad - __int64 resulting from std::distance is 
assigned to int.



Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-23 Thread Thiago Macieira
On Wednesday, 22 March 2023 18:19:59 HST Hamish Moffatt via Interest wrote:
> static constexpr quint8 tagBits =
> QtPrivate::qConstexprCountTrailingZeroBits(alignment);
> 
> So would you fix it with a cast, or by changing the variable type to int
> to match the function?

Either solution is fine. I was thinking of simply adding a quint8() cast around 
the result, but changing to uint also works too. The latter is a smaller 
change anyway.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-22 Thread Hamish Moffatt via Interest

On 23/3/23 05:00, Thiago Macieira wrote:


I don't see any changes since v6.4 that would fix that. It looks trivial though
to apply an explicit cast to silence that warning.

Any chance you can contribute it?


I started with a bug report, anyway: QTBUG-11.


static constexpr quint8 tagBits = 
QtPrivate::qConstexprCountTrailingZeroBits(alignment);


So would you fix it with a cast, or by changing the variable type to int 
to match the function?



Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-22 Thread Hamish Moffatt via Interest

On 22/3/23 18:12, Thiago Macieira wrote:

On Tuesday, 21 March 2023 20:18:17 HST Hamish Moffatt via Interest wrote:

I'm porting from Qt 5.15.12 to 6.4.3, and now MSVC 2019 is giving me a
ton of compiler warnings about QTaggedPointer.

[cut]

Any suggestions on how to shut it up?

Stop using 2019, please. That compiler has a number of unfixed bugs.



Sorry, brain fart. It is indeed 2022, version 17.5.2 - the very latest.


Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-22 Thread Thiago Macieira
On Tuesday, 21 March 2023 20:18:17 HST Hamish Moffatt via Interest wrote:
> I'm porting from Qt 5.15.12 to 6.4.3, and now MSVC 2019 is giving me a
> ton of compiler warnings about QTaggedPointer.
[cut]
> Any suggestions on how to shut it up?

Stop using 2019, please. That compiler has a number of unfixed bugs.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt 6.4.3 compiler warnings in QTaggedPointer

2023-03-22 Thread Hamish Moffatt via Interest
I'm porting from Qt 5.15.12 to 6.4.3, and now MSVC 2019 is giving me a 
ton of compiler warnings about QTaggedPointer.


I don't know what that is, except I see it used in qproperty.h and I use 
a lot of Q_GADGET classes with Q_PROPERTYs.


I'm using /W3 in MSVC and compiling for 64-bit. I've enabled some extra 
warnings on top, but not C2424.



Any suggestions on how to shut it up?

Hamish



1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qtaggedpointer.h(24,1): 
warning C4242: 'initializing': conversion from 'uint' to 'const quint8', 
possible loss of data
1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qtaggedpointer.h(55,1): 
message : see reference to class template instantiation 
'QtPrivate::TagInfo' being compiled

1>    with
1>    [
1>    T=quint16
1>    ]
1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qtaggedpointer.h(49,1): 
message : while compiling class template member function 
'QTaggedPointer::Tag>::QTaggedPointer(T 
*,Tag) noexcept'

1>    with
1>    [
1>    Storage=quint16,
1>    T=quint16,
1> Tag=QtPrivate::QConstPreservingPointer::Tag
1>    ]
1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qiterable.h(32,24): 
message : see reference to function template instantiation 
'QTaggedPointer::Tag>::QTaggedPointer(T 
*,Tag) noexcept' being compiled

1>    with
1>    [
1>    Storage=quint16,
1>    T=quint16,
1> Tag=QtPrivate::QConstPreservingPointer::Tag
1>    ]
1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qiterable.h(19): 
message : see reference to class template instantiation 
'QTaggedPointer::Tag>' 
being compiled

1>    with
1>    [
1>    Storage=quint16
1>    ]
1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qiterable.h(413): 
message : see reference to class template instantiation 
'QtPrivate::QConstPreservingPointer' being compiled
1>C:\qt\Qt6.4.2\6.4.2\msvc2019_64\include\QtCore\qiterable.h(508,2): 
message : see reference to class template instantiation 
'QIterable' being compiled


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest