• ACE Core Typo Bug

    From Johnny Willemsen@21:1/5 to gary on Fri Sep 16 10:21:04 2016
    Hi,

    This is intended, see the history of this change, it is correct, if you have an use case where this fails, please extend ACE_wrappers/tests/Time_Value_Test.cpp and make a github pull request

    Johnny

    On Friday, September 16, 2016 at 11:45:08 AM UTC+2, gary wrote:
    ACE VERSION: 6.4.0

    HOST MACHINE: ALL

    SYNOPSIS:
    Typo bitwise and instead of logical and.

    DESCRIPTION: https://fossies.org/dox/ACE+TAO-src-6.4.0/Time__Value_8inl_source.html

    The “bitwise and” (i.e. &) at line 61 should be a “logical and” (i.e &&)

    REPEAT BY:
    Code Review

    SAMPLE FIX:
    From 6cfd75bc1a5c717739f37a369ab82be4089c1a3d Mon Sep 17 00:00:00 2001
    From: GaryN4
    Date: Thu, 15 Sep 2016 15:43:46 +0100
    Subject: [PATCH] Update Time_Value.inl

    ---
    ACE/ace/Time_Value.inl | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl
    index 98459b4..f748f21 100644
    --- a/ACE/ace/Time_Value.inl
    +++ b/ACE/ace/Time_Value.inl
    @@ -58,7 +58,7 @@ ACE_Time_Value::set (time_t sec, suseconds_t usec)
    this->tv_.tv_sec = sec;
    this->tv_.tv_usec = usec;
    #if __GNUC__ && !(__GNUC__ == 3 && __GNUC_MINOR__ == 4)
    - if ((__builtin_constant_p(sec) &
    + if ((__builtin_constant_p(sec) &&
    __builtin_constant_p(usec)) &&
    (sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS))
    return;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gary@21:1/5 to All on Fri Sep 16 02:44:54 2016
    ACE VERSION: 6.4.0

    HOST MACHINE: ALL

    SYNOPSIS:
    Typo bitwise and instead of logical and.

    DESCRIPTION: https://fossies.org/dox/ACE+TAO-src-6.4.0/Time__Value_8inl_source.html

    The “bitwise and” (i.e. &) at line 61 should be a “logical and” (i.e &&)

    REPEAT BY:
    Code Review

    SAMPLE FIX:
    From 6cfd75bc1a5c717739f37a369ab82be4089c1a3d Mon Sep 17 00:00:00 2001
    From: GaryN4
    Date: Thu, 15 Sep 2016 15:43:46 +0100
    Subject: [PATCH] Update Time_Value.inl

    ---
    ACE/ace/Time_Value.inl | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl
    index 98459b4..f748f21 100644
    --- a/ACE/ace/Time_Value.inl
    +++ b/ACE/ace/Time_Value.inl
    @@ -58,7 +58,7 @@ ACE_Time_Value::set (time_t sec, suseconds_t usec)
    this->tv_.tv_sec = sec;
    this->tv_.tv_usec = usec;
    #if __GNUC__ && !(__GNUC__ == 3 && __GNUC_MINOR__ == 4)
    - if ((__builtin_constant_p(sec) &
    + if ((__builtin_constant_p(sec) &&
    __builtin_constant_p(usec)) &&
    (sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS))
    return;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From garynicholls@gmail.com@21:1/5 to Johnny Willemsen on Mon Sep 19 08:15:31 2016
    Hi Johnny,

    I found this bug from a clang warning:
    #include "ace/Time_Value.h"

    int main(int, char **)
    {
    ACE_Time_Value tv;
    tv.set(100, 100);
    }
    -bash-4.2$ clang -Weverything -I <>/include/ test_ace.cpp

    In file included from <>/include/ace/Time_Value.h:539: <>/include/ace/Time_Value.inl:63:8: warning: will never be
    executed [-Wunreachable-code]
    (sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS))


    Gary

    On Friday, September 16, 2016 at 6:21:07 PM UTC+1, Johnny Willemsen wrote:
    Hi,

    This is intended, see the history of this change, it is correct, if you have an use case where this fails, please extend ACE_wrappers/tests/Time_Value_Test.cpp and make a github pull request

    Johnny

    On Friday, September 16, 2016 at 11:45:08 AM UTC+2, gary wrote:
    ACE VERSION: 6.4.0

    HOST MACHINE: ALL

    SYNOPSIS:
    Typo bitwise and instead of logical and.

    DESCRIPTION: https://fossies.org/dox/ACE+TAO-src-6.4.0/Time__Value_8inl_source.html

    The “bitwise and” (i.e. &) at line 61 should be a “logical and” (i.e &&)

    REPEAT BY:
    Code Review

    SAMPLE FIX:
    From 6cfd75bc1a5c717739f37a369ab82be4089c1a3d Mon Sep 17 00:00:00 2001 From: GaryN4
    Date: Thu, 15 Sep 2016 15:43:46 +0100
    Subject: [PATCH] Update Time_Value.inl

    ---
    ACE/ace/Time_Value.inl | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl
    index 98459b4..f748f21 100644
    --- a/ACE/ace/Time_Value.inl
    +++ b/ACE/ace/Time_Value.inl
    @@ -58,7 +58,7 @@ ACE_Time_Value::set (time_t sec, suseconds_t usec)
    this->tv_.tv_sec = sec;
    this->tv_.tv_usec = usec;
    #if __GNUC__ && !(__GNUC__ == 3 && __GNUC_MINOR__ == 4)
    - if ((__builtin_constant_p(sec) &
    + if ((__builtin_constant_p(sec) &&
    __builtin_constant_p(usec)) &&
    (sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS))
    return;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johnny Willemsen@21:1/5 to gary on Thu Sep 22 23:45:16 2016
    Hi,

    Please create a pull request at https://github.com/DOCGroup/ACE_TAO

    Johnny

    On Friday, September 16, 2016 at 11:45:08 AM UTC+2, gary wrote:
    ACE VERSION: 6.4.0

    HOST MACHINE: ALL

    SYNOPSIS:
    Typo bitwise and instead of logical and.

    DESCRIPTION: https://fossies.org/dox/ACE+TAO-src-6.4.0/Time__Value_8inl_source.html

    The “bitwise and” (i.e. &) at line 61 should be a “logical and” (i.e &&)

    REPEAT BY:
    Code Review

    SAMPLE FIX:
    From 6cfd75bc1a5c717739f37a369ab82be4089c1a3d Mon Sep 17 00:00:00 2001
    From: GaryN4
    Date: Thu, 15 Sep 2016 15:43:46 +0100
    Subject: [PATCH] Update Time_Value.inl

    ---
    ACE/ace/Time_Value.inl | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl
    index 98459b4..f748f21 100644
    --- a/ACE/ace/Time_Value.inl
    +++ b/ACE/ace/Time_Value.inl
    @@ -58,7 +58,7 @@ ACE_Time_Value::set (time_t sec, suseconds_t usec)
    this->tv_.tv_sec = sec;
    this->tv_.tv_usec = usec;
    #if __GNUC__ && !(__GNUC__ == 3 && __GNUC_MINOR__ == 4)
    - if ((__builtin_constant_p(sec) &
    + if ((__builtin_constant_p(sec) &&
    __builtin_constant_p(usec)) &&
    (sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS))
    return;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)