Re: [Interest] Klocwork errors in Qt

2019-12-16 Thread Elvis Stansvik
Den mån 16 dec. 2019 15:16Stefan Neubert skrev: > > On Sat, 14 Dec 2019 at 21:57, Roland Hughes > wrote: > > > On 12/14/19 2:54 PM, Massimiliano Maini wrote: > > > > > > On Sat, 14 Dec 2019 at 15:12, Roland Hughes > > mailto:rol...@logikalsolutions.com>> > wrote: > > > > On 12/9/19 5:00 AM,

Re: [Interest] Klocwork errors in Qt

2019-12-16 Thread Stefan Neubert
> On Sat, 14 Dec 2019 at 21:57, Roland Hughes wrote: On 12/14/19 2:54 PM, Massimiliano Maini wrote: > > > On Sat, 14 Dec 2019 at 15:12, Roland Hughes > > wrote: > >     On 12/9/19 5:00 AM, Massimiliano Maini wrote: >     > On Fri, 6 Dec 2019 at 19:41, Max Paperno >     >  wrote: >     >

Re: [Interest] Klocwork errors in Qt

2019-12-15 Thread Massimiliano Maini
I do accept. You passed the test for being a troll. Well done. On Sun, 15 Dec 2019 at 20:12, Roland Hughes wrote: > > On 12/15/19 8:32 AM, Massimiliano Maini wrote: > > On Sun, 15 Dec 2019 at 00:20, Roland Hughes > > mailto:rol...@logikalsolutions.com>> > wrote: > > > > > > On 12/14/19 4:07

Re: [Interest] Klocwork errors in Qt

2019-12-15 Thread Massimiliano Maini
On Sun, 15 Dec 2019 at 00:20, Roland Hughes wrote: > > On 12/14/19 4:07 PM, Massimiliano Maini wrote: > > > > The day you want to start talking about your own assumptions with > > respect the competency > > level of anybody else than you on this mailing list, let us know. > > > Btw, I didn't make

Re: [Interest] Klocwork errors in Qt

2019-12-14 Thread Massimiliano Maini
On Sat, 14 Dec 2019 at 21:57, Roland Hughes wrote: > > On 12/14/19 2:54 PM, Massimiliano Maini wrote: > > > > > > On Sat, 14 Dec 2019 at 15:12, Roland Hughes > > mailto:rol...@logikalsolutions.com>> > wrote: > > > > On 12/9/19 5:00 AM, Massimiliano Maini wrote: > > > On Fri, 6 Dec 2019 at

Re: [Interest] Klocwork errors in Qt

2019-12-14 Thread Massimiliano Maini
On Sat, 14 Dec 2019 at 15:12, Roland Hughes wrote: > On 12/9/19 5:00 AM, Massimiliano Maini wrote: > > On Fri, 6 Dec 2019 at 19:41, Max Paperno wrote: > > > >> On 12/4/2019 9:31 AM, Roland Hughes wrote: > >>> If you think auto won't be removed as a failed experiment, how about > >> "new"? Deprec

Re: [Interest] Klocwork errors in Qt

2019-12-14 Thread Thiago Macieira
On Monday, 9 December 2019 05:27:06 PST Roland Hughes wrote: > auto will be removed though. A bad idea that cannot be fixed. So were > trigraphs and digraphs. > > There is a dramatic falsehood behind the philosophy of always using the > latest and "coolest" language "features" because they get rem

Re: [Interest] Klocwork errors in Qt

2019-12-14 Thread Giuseppe D'Angelo via Interest
Il 09/12/19 14:27, Roland Hughes ha scritto: Gosh no. I'm more stunned that only one person got it. That was an incredibly well written post. Everyone should read it. Too many QML users I guess. auto will be removed though. A bad idea that cannot be fixed. So were trigraphs and digraphs. There

Re: [Interest] Klocwork errors in Qt

2019-12-14 Thread Roland Hughes
On 12/9/19 5:00 AM, Massimiliano Maini wrote: On Fri, 6 Dec 2019 at 19:41, Max Paperno wrote: On 12/4/2019 9:31 AM, Roland Hughes wrote: If you think auto won't be removed as a failed experiment, how about "new"? Deprecated in C++20 and slated for removal in C++23. https://www.modernescpp.c

Re: [Interest] Klocwork errors in Qt

2019-12-09 Thread Konstantin Tokarev
09.12.2019, 11:00, "Massimiliano Maini" : > On Fri, 6 Dec 2019 at 19:41, Max Paperno wrote: >> On 12/4/2019 9:31 AM, Roland Hughes wrote: >>> If you think auto won't be removed as a failed experiment, how about "new"? >>> Deprecated in C++20 and slated for removal in C++23. >>> >>> https://www.

Re: [Interest] Klocwork errors in Qt

2019-12-09 Thread Massimiliano Maini
On Fri, 6 Dec 2019 at 19:41, Max Paperno wrote: > On 12/4/2019 9:31 AM, Roland Hughes wrote: > > If you think auto won't be removed as a failed experiment, how about > "new"? Deprecated in C++20 and slated for removal in C++23. > > > > https://www.modernescpp.com/index.php/no-new-new > > Some mor

Re: [Interest] Klocwork errors in Qt

2019-12-06 Thread Max Paperno
On 12/4/2019 9:31 AM, Roland Hughes wrote: If you think auto won't be removed as a failed experiment, how about "new"? Deprecated in C++20 and slated for removal in C++23. https://www.modernescpp.com/index.php/no-new-new Some more reading on the removal of pointers https://www.fluentcpp.com/20

Re: [Interest] Klocwork errors in Qt

2019-12-06 Thread Roland Hughes
On 12/4/19 5:00 AM, Thiago Macieira wrote: On Tuesday, 3 December 2019 17:36:37 PST Christian Gagneraud wrote: My point is that this sort of bugs are really hard to detect during code review. This is subtle & nasty 'feature' of QStringBuilder (a choice in its implementation). Understood, but i

Re: [Interest] Klocwork errors in Qt

2019-12-05 Thread Ramakanth Kesireddy
Thanks for all the suggestions. Atleast we are not using auto for the concatenation of QStrings. On Thu, Dec 5, 2019 at 2:33 PM Giuseppe D'Angelo via Interest < interest@qt-project.org> wrote: > Il 05/12/19 00:54, Thiago Macieira ha scritto: > > Same issue (dangling pointer), no "auto" required.

Re: [Interest] Klocwork errors in Qt

2019-12-05 Thread Giuseppe D'Angelo via Interest
Il 05/12/19 00:54, Thiago Macieira ha scritto: Same issue (dangling pointer), no "auto" required. Or QStringView f() { QString s("hello"); return s; } Or even QVector v; v << QString("world"); etc. Really, one can build countless examples where Modern C++ will gladly make you sho

Re: [Interest] Klocwork errors in Qt

2019-12-04 Thread Thiago Macieira
On Wednesday, 4 December 2019 14:59:41 PST Giuseppe D'Angelo via Interest wrote: > Let me elaborate: the original claim was that QStringBuilder is > dangerous. It's not (*). The danger can only happen as a misuse of it > and it's not inherent to QStringBuilder itself, just like other > countless t

Re: [Interest] Klocwork errors in Qt

2019-12-04 Thread Giuseppe D'Angelo via Interest
Hi, Il 04/12/19 13:56, Christian Gagneraud ha scritto: On Wed, 4 Dec 2019 at 19:28, Giuseppe D'Angelo via Interest wrote: Il 04/12/19 02:36, Christian Gagneraud ha scritto: BTW, Clazy has a check for that very specific case, which just show how dangerous is this QStringBuilder. https://githu

Re: [Interest] Klocwork errors in Qt

2019-12-04 Thread Thiago Macieira
On Wednesday, 4 December 2019 04:56:00 PST Christian Gagneraud wrote: > > As a professional developer, one should strive for keeping a codebase > > under clazy, clang-tidy, and friends; and always be under -Werror. > > Really? (sarcasm) > There's what you wish, and there's what you're asked (or al

Re: [Interest] Klocwork errors in Qt

2019-12-04 Thread André Pönitz
On Wed, Dec 04, 2019 at 02:36:37PM +1300, Christian Gagneraud wrote: > On Wed, 4 Dec 2019 at 13:05, Thiago Macieira > wrote: > > > IMHO, it is legit to write code like: > > > const QUrl url(urlString); > > > const auto appId = url.host() + "." + url.path().mid(1); > > > doSomeThing(appId); // voi

Re: [Interest] Klocwork errors in Qt

2019-12-04 Thread Christian Gagneraud
On Wed, 4 Dec 2019 at 16:06, Thiago Macieira wrote: > > On Tuesday, 3 December 2019 17:36:37 PST Christian Gagneraud wrote: > > My point is that this sort of bugs are really hard to detect during > > code review. This is subtle & nasty 'feature' of QStringBuilder (a > > choice in its implementatio

Re: [Interest] Klocwork errors in Qt

2019-12-04 Thread Christian Gagneraud
On Wed, 4 Dec 2019 at 19:28, Giuseppe D'Angelo via Interest wrote: > > Il 04/12/19 02:36, Christian Gagneraud ha scritto: > > BTW, Clazy has a check for that very specific case, which just show > > how dangerous is this QStringBuilder. > > https://github.com/KDE/clazy/blob/master/docs/checks/READM

Re: [Interest] Klocwork errors in Qt

2019-12-03 Thread Giuseppe D'Angelo via Interest
Il 04/12/19 02:36, Christian Gagneraud ha scritto: BTW, Clazy has a check for that very specific case, which just show how dangerous is this QStringBuilder. https://github.com/KDE/clazy/blob/master/docs/checks/README-auto-unexpected-qstringbuilder.md As a professional developer, one should stri

Re: [Interest] Klocwork errors in Qt

2019-12-03 Thread Thiago Macieira
On Tuesday, 3 December 2019 17:36:37 PST Christian Gagneraud wrote: > My point is that this sort of bugs are really hard to detect during > code review. This is subtle & nasty 'feature' of QStringBuilder (a > choice in its implementation). Understood, but it shows up quickly when running the code

Re: [Interest] Klocwork errors in Qt

2019-12-03 Thread Christian Gagneraud
On Wed, 4 Dec 2019 at 13:05, Thiago Macieira wrote: > > IMHO, it is legit to write code like: > > const QUrl url(urlString); > > const auto appId = url.host() + "." + url.path().mid(1); > > doSomeThing(appId); // void doSomeThing(const QString &stuff); > > > > Yet it results in crashes, apparently

Re: [Interest] Klocwork errors in Qt

2019-12-03 Thread Thiago Macieira
On Tuesday, 3 December 2019 14:40:08 PST Christian Gagneraud wrote: > > No, there's no need. QStringBuilder works just fine and has been working > > for over 10 years. Either there's a problem somewhere in your code that > > you didn't show to us or it s a Klocwork false positive. > > To me it see

Re: [Interest] Klocwork errors in Qt

2019-12-03 Thread Christian Gagneraud
On Tue, 3 Dec 2019 at 20:09, Thiago Macieira wrote: > > On Monday, 2 December 2019 18:53:14 PST Ramakanth Kesireddy wrote: > > We got below errors in Qt 5.13 using C++ QWidgets while running static code > > analysis withKlocwork: > > > > 1)Address of a local variable is returned via return stateme

Re: [Interest] Klocwork errors in Qt

2019-12-02 Thread Thiago Macieira
On Monday, 2 December 2019 18:53:14 PST Ramakanth Kesireddy wrote: > We got below errors in Qt 5.13 using C++ QWidgets while running static code > analysis withKlocwork: > > 1)Address of a local variable is returned via return statement expression > 'QStringBuilder,const char[2]>(a, > &b).b'. > 2)

[Interest] Klocwork errors in Qt

2019-12-02 Thread Ramakanth Kesireddy
Hi, We got below errors in Qt 5.13 using C++ QWidgets while running static code analysis withKlocwork: 1)Address of a local variable is returned via return statement expression 'QStringBuilder,const char[2]>(a, &b).b'. 2)Address of a local variable is returned via return statement expression 'QSt