[AGENT++] why is std::list, std::array, or std::queue not used?

Frank Fock fock at agentpp.com
Sun Aug 26 08:29:25 CEST 2018


Hi Claus,
Those „standard“ collections have *not* been used because of „portable, readable, and clean code“! The interface of the AGENT++ implements had not been changed for 20 years now. 
I am not sure that you could have managed that with std:: implementations during this time frame. 
Of course, this might change in the future. Therefore we observe the situation, but it is to early to do it now, because there have not been found any bug/drawback in the current implementations for many years now (besides false alarms).

Best regards 
Frank

> Am 25.08.2018 um 17:56 schrieb Claus Klein <claus.klein at arcormail.de>:
> 
> I had a dream of portable, readable, clean code without #ifdef
> using nothing else than -std=c++14 and boost as a wrapper for older c++03 compilers.
> 
> Best regards
> Claus
> 
> /usr/local/include/agent_pp/List.h:945:0: warning: Either the condition 'if(h)' is redundant or there is possible null pointer dereference: h. [nullPointerRedundantCheck]
>        memcpy(content + 1, h, sz * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:947:0: note: Assuming that condition 'if(h)' is not redundant
>        if (h) {
> ^
> /usr/local/include/agent_pp/List.h:945:0: note: Null pointer dereference
>        memcpy(content + 1, h, sz * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:966:0: warning: Either the condition 'if(h)' is redundant or there is possible null pointer dereference: h. [nullPointerRedundantCheck]
>        memcpy(content, h, sz * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:968:0: note: Assuming that condition 'if(h)' is not redundant
>        if (h) {
> ^
> /usr/local/include/agent_pp/List.h:966:0: note: Null pointer dereference
>        memcpy(content, h, sz * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:1002:0: warning: Either the condition 'if(h)' is redundant or there is possible null pointer dereference: h. [nullPointerRedundantCheck]
>                memcpy(content, h, i * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:1005:0: note: Assuming that condition 'if(h)' is not redundant
>                if (h) {
> ^
> /usr/local/include/agent_pp/List.h:1002:0: note: Null pointer dereference
>                memcpy(content, h, i * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:1003:0: warning: Either the condition 'if(h)' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
>                memcpy(content + i + 1, h + i, (sz - i) * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:1005:0: note: Assuming that condition 'if(h)' is not redundant
>                if (h) {
> ^
> /usr/local/include/agent_pp/List.h:1003:0: note: Null pointer addition
>                memcpy(content + i + 1, h + i, (sz - i) * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:1061:0: warning: Either the condition 'if(h)' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
>        memcpy(content, h + 1, sz * sizeof(T*));
> ^
> /usr/local/include/agent_pp/List.h:1062:0: note: Assuming that condition 'if(h)' is not redundant
>        if (h) {
> ^
> /usr/local/include/agent_pp/List.h:1061:0: note: Null pointer addition
>        memcpy(content, h + 1, sz * sizeof(T*));
> ^
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> https://oosnmp.net/mailman/listinfo/agentpp



More information about the AGENTPP mailing list