Task #1936

Compiling upp with GCC version 8.2.1 causing many warnings

Added by Zbigniew Rebacz 8 months ago. Updated 7 months ago.

Status:ApprovedStart date:03/02/2019
Priority:NormalDue date:
Assignee:Zbigniew Rebacz% Done:

0%

Category:CoreSpent time:-
Target version:Release 2019.1 - NTH

Description

You can find that GCC version on Manjaro linux ;)

Here is the warning generated by regular clean build on that distribution - the build method is stock method:

/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/CtrlLib/Text.cpp (417): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializa
tion instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization in
stead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization ins
tead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::ArrayCtrl::Line’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Vector<Upp::ArrayCtrl::CellInfo>’ with no trivial copy-assignment [-Wclass-memacc
ess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializa
tion instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization in
stead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::ArrayCtrl::Line’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::ArrayCtrl::Line’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::ArrayCtrl::Line’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Vector<Upp::ArrayCtrl::CellInfo>’ with no trivial copy-assignment [-Wclass-memacces
s]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Vector<Upp::ArrayCtrl::CellInfo>’ with no trivial copy-assignment [-Wclass-memacces
s]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Vector<Upp::ArrayCtrl::CellInfo>’ with no trivial copy-assignment [-Wclass-memacc
ess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization inste
ad [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization inste
ad [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization ins
tead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/RichText/EncodeHTML.cpp (352): warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
/home/klugier/upp/uppsrc/RichText/EncodeHTML.cpp (355): warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::RichTxt::Part’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::RichTxt::Part’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::RichTxt::Part’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::RichTxt::Part’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (349): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::RichTxt::Part’ with no trivial copy-assignment [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/Draw/Uhd.cpp (92): warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (349): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘struct Upp::Rect_<int>’; use copy-assignment or copy-initialization instead 
[-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘struct Upp::Rect_<int>’; use copy-assignment or copy-initialization instead 
[-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘struct Upp::Rect_<int>’; use copy-assignment or copy-initialization instead 
[-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘struct Upp::Rect_<int>’; use copy-assignment or copy-initialization instea
d [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/CtrlCore/GtkX11Util.cpp (47): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/CtrlCore/GtkEvent.cpp (538): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::Ctrl::Win’ with no trivial copy-assignment; use copy-assignment or copy-initializatio
n instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Ptr<Upp::Ctrl>’ with no trivial copy-assignment; use copy-assignment or copy-initial
ization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializa
tion instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::TextCtrl::Ln’ with no trivial copy-assignment; use copy-assignment or copy-initializa
tion instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (630): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::Ctrl::GEvent’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (632): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::Ctrl::GEvent’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (633): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::Ctrl::GEvent’ with no trivial copy-assignment; use copy-assignment or copy-initializati
on instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::WString’ with no trivial copy-assignment; use copy-assignment or copy-initialization i
nstead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (232): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization ins
tead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization in
stead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (275): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization inste
ad [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (276): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization inste
ad [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (282): warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Value’ with no trivial copy-assignment; use copy-assignment or copy-initialization ins
tead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (630): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Function<void()>’ with no trivial copy-assignment; use copy-assignment or copy-initial
ization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (632): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Function<void()>’ with no trivial copy-assignment; use copy-assignment or copy-initial
ization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (633): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::Function<void()>’ with no trivial copy-assignment; use copy-assignment or copy-initial
ization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (630): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::WebSocket::Input’ with no trivial copy-assignment; use copy-assignment or copy-initi
alization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (632): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::WebSocket::Input’ with no trivial copy-assignment; use copy-assignment or copy-initi
alization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (633): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Upp::WebSocket::Input’ with no trivial copy-assignment; use copy-assignment or copy-initi
alization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Core.h (347): In file included from /home/klugier/upp/uppsrc/Core/Core.h:347,
/home/klugier/upp/uppsrc/Core/Cpu.cpp (1): from /home/klugier/upp/uppsrc/Core/Cpu.cpp:1,
/home/klugier/out/examples/Core/GCC.Debug.Debug_Full.Gui.Mt.Shared/$blitz.cpp (3): from /home/klugier/out/examples/Core/GCC.Debug.Debug_Full.Gui.Mt.Shared/$blitz.cpp:3:
/home/klugier/upp/uppsrc/Core/Core.h (351): In file included from /home/klugier/upp/uppsrc/Core/Core.h:351,
/home/klugier/upp/uppsrc/Core/Cpu.cpp (1): from /home/klugier/upp/uppsrc/Core/Cpu.cpp:1,
/home/klugier/out/examples/Core/GCC.Debug.Debug_Full.Gui.Mt.Shared/$blitz.cpp (3): from /home/klugier/out/examples/Core/GCC.Debug.Debug_Full.Gui.Mt.Shared/$blitz.cpp:3:
 (): memcpy(newvector + alloc - start, vector, (end - alloc) * sizeof(T));
/home/klugier/upp/uppsrc/Core/Inet.h (621): note: ‘struct Upp::WebSocket::Input’ declared here
 (): struct Input : Moveable<Input> {
 (): /home/klugier/upp/uppsrc/Core/Vcont.hpp: In instantiation of ‘void Upp::BiVector<T>::ReAlloc(int) [with T = Upp::String]’:
/home/klugier/upp/uppsrc/Core/Vcont.hpp (670): required from ‘void Upp::BiVector<T>::Add0() [with T = Upp::String]’
/home/klugier/upp/uppsrc/Core/BiCont.h (16): required from ‘T* Upp::BiVector<T>::AddTail0() [with T = Upp::String]’
/home/klugier/upp/uppsrc/Core/BiCont.h (31): required from ‘void Upp::BiVector<T>::AddTail(const T&) [with T = Upp::String]’
/home/klugier/upp/uppsrc/Core/WebSocket.cpp (425): required from here
/home/klugier/upp/uppsrc/Core/Vcont.hpp (630): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (632): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Vcont.hpp (633): warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class Upp::String’ with no trivial copy-assignment; use copy-assignment or copy-initialization inst
ead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/Other.h (133): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]

CppBaseWarningFixes.diff Magnifier (1.12 KB) Zbigniew Rebacz, 03/17/2019 11:58 AM

History

#1 Updated by Zbigniew Rebacz 8 months ago

  • Description updated (diff)
  • Assignee changed from Peter Helcmanovsky to Miroslav Fidler

#2 Updated by Miroslav Fidler 8 months ago

  • Status changed from New to Ready for QA
  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

#3 Updated by Zbigniew Rebacz 7 months ago

  • Status changed from Ready for QA to In Progress
  • Assignee changed from Zbigniew Rebacz to Miroslav Fidler

Mirek, can you compile TheIDE with the new build method it seems that we have warnings too and there are still some warnings in Core and CtrlCore. We should fix it.

Here is output from TheIDE compilation (using TheIDE):

/home/klugier/upp/uppsrc/ide/LayDes/laydes.cpp (1702): warning: enum constant in boolean context [-Wint-in-bool-context]
 (): item.SetCursor(k = K_DOWN ? 0 : item.GetCount() - 1);
/home/klugier/upp/uppsrc/CodeEditor/DiffSyntax.cpp (82): warning: comparison of integer expressions of different signedness: ‘Upp::dword’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/Core/Defs.h (274): warning: comparison of integer expressions of different signedness: ‘const int’ and ‘const unsigned int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/Core/Defs.h (274): warning: comparison of integer expressions of different signedness: ‘const int’ and ‘const unsigned int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/Core/Defs.h (274): warning: comparison of integer expressions of different signedness: ‘const int’ and ‘const unsigned int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/Core/Defs.h (274): warning: comparison of integer expressions of different signedness: ‘const int’ and ‘const unsigned int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/plugin/zstd/Decompress.cpp (76): warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/plugin/zstd/Decompress.cpp (268): warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
/home/klugier/upp/uppsrc/Core/sheap.cpp (425): warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct Upp::MemoryProfile’; use assignment or value-initialization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/Core/heaputil.cpp (250): warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct Upp::MemoryProfile’; use assignment or value-initialization instead [-Wclass-memaccess]
/home/klugier/upp/uppsrc/CppBase/macro.cpp (76): warning: variable ‘variadic’ set but not used [-Wunused-but-set-variable]
/home/klugier/upp/uppsrc/CppBase/Body.cpp (38): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/CtrlLib/Text.cpp (417): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/CtrlCore/GtkX11Util.cpp (47): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
/home/klugier/upp/uppsrc/CtrlCore/GtkEvent.cpp (538): warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]

#4 Updated by Zbigniew Rebacz 7 months ago

Please apply this fixes for CppBase. I can not commit to this repository.

#5 Updated by Miroslav Fidler 7 months ago

  • Status changed from In Progress to Ready for QA
  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

#6 Updated by Zbigniew Rebacz 7 months ago

  • Status changed from Ready for QA to Approved

Good job - no warnings for TheIDE compilation using GCC.

Also available in: Atom PDF