[GH-ISSUE #284] Clang warning #88

Closed
opened 2026-05-05 03:39:02 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @klugier on GitHub (Jun 24, 2025).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/284

Originally assigned to: @mirek-fidler on GitHub.

It looks like there is a lot of warning on the latest version. It repeates many time (Below are logs from Clock example compilation):
/home/klugier/upp/git/uppsrc/Core/Topt.h (212): warning: first argument in call to 'memmove' is a pointer to non-trivially copyable type 'Upp::TextCtrl::Ln' [-Wnontrivial-memcall]

Image

It looks like it might be a problem of clnag 20.1.6. I recently updated packages on my operating system. On g++ (GCC) 15.1.1 20250425 these warnings are not presetn.

Originally created by @klugier on GitHub (Jun 24, 2025). Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/284 Originally assigned to: @mirek-fidler on GitHub. It looks like there is a lot of warning on the latest version. It repeates many time (Below are logs from Clock example compilation): /home/klugier/upp/git/uppsrc/Core/Topt.h (212): warning: first argument in call to 'memmove' is a pointer to non-trivially copyable type 'Upp::TextCtrl::Ln' [-Wnontrivial-memcall] ![Image](https://github.com/user-attachments/assets/2e7cc737-ef31-4380-a781-daf410473467) It looks like it might be a problem of clnag 20.1.6. I recently updated packages on my operating system. On g++ (GCC) 15.1.1 20250425 these warnings are not presetn.
Author
Owner

@ismail-yilmaz commented on GitHub (Jun 24, 2025):

Yes, I can confirm this.

<!-- gh-comment-id:3001178516 --> @ismail-yilmaz commented on GitHub (Jun 24, 2025): Yes, I can confirm this.
Author
Owner

@mirek-fidler commented on GitHub (Jun 25, 2025):

Would this help

	memmove((void *)dst, (void *)src, n * sizeof(T));

or
memmove(reintepret_cast<void *>(dst), reinterpret_cast<void *>(src), n * sizeof(T));

?

(If not, we need to implement non-inline memmove_ callin memmove, which will be potentially less optimal).

<!-- gh-comment-id:3003530195 --> @mirek-fidler commented on GitHub (Jun 25, 2025): Would this help memmove((void *)dst, (void *)src, n * sizeof(T)); or memmove(reintepret_cast<void *>(dst), reinterpret_cast<void *>(src), n * sizeof(T)); ? (If not, we need to implement non-inline memmove_ callin memmove, which will be potentially less optimal).
Author
Owner

@klugier commented on GitHub (Jun 25, 2025):

Yes, The first and second variant works and silences warning. However, still there is one more warning to solve (Core/Topt - line 177):

template <class T>
inline typename std::enable_if_t<is_trivially_relocatable<T>> Relocate(T *dst, T *src)
{
	memcpy(dst, src, sizeof(T));
}

/home/klugier/upp/git/uppsrc/Core/Topt.h (177): warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type 'Upp::Value' [-Wnontrivial-memcall]

<!-- gh-comment-id:3006009978 --> @klugier commented on GitHub (Jun 25, 2025): Yes, The first and second variant works and silences warning. However, still there is one more warning to solve (Core/Topt - line 177): ``` template <class T> inline typename std::enable_if_t<is_trivially_relocatable<T>> Relocate(T *dst, T *src) { memcpy(dst, src, sizeof(T)); } ``` /home/klugier/upp/git/uppsrc/Core/Topt.h (177): warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type 'Upp::Value' [-Wnontrivial-memcall]
Author
Owner

@mirek-fidler commented on GitHub (Jun 25, 2025):

So what do we like better, reinterpret_cast or C style?

On Wed, Jun 25, 2025 at 10:12 PM Zbigniew Rębacz @.***>
wrote:

klugier left a comment (ultimatepp/ultimatepp#284)
https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006009978

Yes, The first and second variant works and silences warning. However,
still there is one more warning to solve (Core/Topt - line 177):

template
inline typename std::enable_if_t<is_trivially_relocatable> Relocate(T *dst, T *src)
{
memcpy(dst, src, sizeof(T));
}

/home/klugier/upp/git/uppsrc/Core/Topt.h (177): warning: first argument in
call to 'memcpy' is a pointer to non-trivially copyable type 'Upp::Value'
[-Wnontrivial-memcall]


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006009978,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH23ZTE5TPGVJ5ZM6XRTT3FL7B7AVCNFSM6AAAAACAA4GPWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBWGAYDSOJXHA
.
You are receiving this because you were assigned.Message ID:
@.***>

<!-- gh-comment-id:3006076667 --> @mirek-fidler commented on GitHub (Jun 25, 2025): So what do we like better, reinterpret_cast or C style? On Wed, Jun 25, 2025 at 10:12 PM Zbigniew Rębacz ***@***.***> wrote: > *klugier* left a comment (ultimatepp/ultimatepp#284) > <https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006009978> > > Yes, The first and second variant works and silences warning. However, > still there is one more warning to solve (Core/Topt - line 177): > > template <class T> > inline typename std::enable_if_t<is_trivially_relocatable<T>> Relocate(T *dst, T *src) > { > memcpy(dst, src, sizeof(T)); > } > > /home/klugier/upp/git/uppsrc/Core/Topt.h (177): warning: first argument in > call to 'memcpy' is a pointer to non-trivially copyable type 'Upp::Value' > [-Wnontrivial-memcall] > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006009978>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH23ZTE5TPGVJ5ZM6XRTT3FL7B7AVCNFSM6AAAAACAA4GPWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBWGAYDSOJXHA> > . > You are receiving this because you were assigned.Message ID: > ***@***.***> >
Author
Owner

@klugier commented on GitHub (Jun 25, 2025):

I think you prefer C style casting :) I personally prefer C++ like casting, but do as you like. Also C like casting is shorter. All these C++ casts are long in context of text size.

<!-- gh-comment-id:3006084003 --> @klugier commented on GitHub (Jun 25, 2025): I think you prefer C style casting :) I personally prefer C++ like casting, but do as you like. Also C like casting is shorter. All these C++ casts are long in context of text size.
Author
Owner

@mirek-fidler commented on GitHub (Jun 25, 2025):

It feels "low level" and "hack", which is appropriate here :)

On Wed, Jun 25, 2025 at 10:40 PM Zbigniew Rębacz @.***>
wrote:

klugier left a comment (ultimatepp/ultimatepp#284)
https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006084003

I think you prefer C style casting :) I personally prefer C++ like
casting, but do as you like.


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006084003,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH234PVUS74ATOFF4X3ID3FMCNXAVCNFSM6AAAAACAA4GPWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBWGA4DIMBQGM
.
You are receiving this because you were assigned.Message ID:
@.***>

<!-- gh-comment-id:3006094801 --> @mirek-fidler commented on GitHub (Jun 25, 2025): It feels "low level" and "hack", which is appropriate here :) On Wed, Jun 25, 2025 at 10:40 PM Zbigniew Rębacz ***@***.***> wrote: > *klugier* left a comment (ultimatepp/ultimatepp#284) > <https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006084003> > > I think you prefer C style casting :) I personally prefer C++ like > casting, but do as you like. > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/284#issuecomment-3006084003>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH234PVUS74ATOFF4X3ID3FMCNXAVCNFSM6AAAAACAA4GPWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBWGA4DIMBQGM> > . > You are receiving this because you were assigned.Message ID: > ***@***.***> >
Author
Owner

@klugier commented on GitHub (Jun 26, 2025):

Should we port these changes to latest release? This issue will be observe there especially when somebody pair TheIDE with latest clang. Also, there is a problem with crashing assist, which should also be address https://www.ultimatepp.org/forums/index.php?t=msg&goto=61710&#msg_61710 (optimally also on release).

<!-- gh-comment-id:3007140898 --> @klugier commented on GitHub (Jun 26, 2025): Should we port these changes to latest release? This issue will be observe there especially when somebody pair TheIDE with latest clang. Also, there is a problem with crashing assist, which should also be address https://www.ultimatepp.org/forums/index.php?t=msg&goto=61710&#msg_61710 (optimally also on release).
Author
Owner

@klugier commented on GitHub (Jul 2, 2025):

Since now we have both fixes, I think we should port them to stable and create new release. The fixes are:

The reason for creating new release is that for some distor with latest clangs and newer the experience won't be good. I would not wait for the new release. Just do 2025.1.1.

<!-- gh-comment-id:3029224124 --> @klugier commented on GitHub (Jul 2, 2025): Since now we have both fixes, I think we should port them to stable and create new release. The fixes are: - https://github.com/ultimatepp/ultimatepp/commit/859a6e2515d3948950756319c7ecb21b954cc4bf - https://github.com/ultimatepp/ultimatepp/commit/e4a77b45ad1e8448203acddc680af45e0d3c1f94 The reason for creating new release is that for some distor with latest clangs and newer the experience won't be good. I would not wait for the new release. Just do 2025.1.1.
Author
Owner

@mirek-fidler commented on GitHub (Jul 3, 2025):

https://www.ultimatepp.org/forums/index.php?t=msg&goto=61723&#msg_61723

<!-- gh-comment-id:3031500916 --> @mirek-fidler commented on GitHub (Jul 3, 2025): https://www.ultimatepp.org/forums/index.php?t=msg&goto=61723&#msg_61723
Author
Owner

@ismail-yilmaz commented on GitHub (Jul 3, 2025):

https://www.ultimatepp.org/forums/index.php?t=msg&goto=61723&#msg_61723

The link in the description is invaild, requires login ("upload"): https://sourceforge.net/projects/upp/upload/upp/2025.1.1rc1/

<!-- gh-comment-id:3032693882 --> @ismail-yilmaz commented on GitHub (Jul 3, 2025): > https://www.ultimatepp.org/forums/index.php?t=msg&goto=61723&#msg_61723 The link in the description is invaild, requires login ("upload"): https://sourceforge.net/projects/upp/upload/upp/2025.1.1rc1/
Author
Owner

@mirek-fidler commented on GitHub (Jul 3, 2025):

Thanks

<!-- gh-comment-id:3032824766 --> @mirek-fidler commented on GitHub (Jul 3, 2025): Thanks
Author
Owner

@klugier commented on GitHub (Jul 4, 2025):

I am closing now. Thanks for quick fix and making new release candidate

<!-- gh-comment-id:3034814266 --> @klugier commented on GitHub (Jul 4, 2025): I am closing now. Thanks for quick fix and making new release candidate
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ultimatepp#88
No description provided.