You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/07/19 15:03:44 UTC

[GitHub] [incubator-nuttx] acassis edited a comment on pull request #1423: Use AVR Linux toolchain instead of buildroot in default configs

acassis edited a comment on pull request #1423:
URL: https://github.com/apache/incubator-nuttx/pull/1423#issuecomment-660659044


   Hi @xiaoxiang781216 @btashton it is reporting "error: left shift count >= width of type"
   Could you please apply this patch:
   
   <pre>
   [PATCH] Fix error: left shift count >= width of type
   
   ---
    libs/libc/net/lib_inetaddr.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)
   
   diff --git a/libs/libc/net/lib_inetaddr.c b/libs/libc/net/lib_inetaddr.c
   index e71ee8e011..1b6db62bc4 100644
   --- a/libs/libc/net/lib_inetaddr.c
   +++ b/libs/libc/net/lib_inetaddr.c
   @@ -102,7 +102,7 @@ in_addr_t inet_addr(FAR const char *cp)
            {
              if ((a < 0x100) && (b < 0x1000000))
                {
   -              result = (a << 24) | b;
   +              result = (((uint32_t) a) << 24) | b;
                }
              break;
            }
   @@ -111,7 +111,7 @@ in_addr_t inet_addr(FAR const char *cp)
            {
              if ((a < 0x100) && (b < 0x100) && (c < 0x10000))
                {
   -              result = (a << 24) | (b << 16) | c;
   +              result = (((uint32_t) a) << 24) | (((uint32_t) b) << 16) | c;
                }
              break;
            }
   @@ -120,7 +120,8 @@ in_addr_t inet_addr(FAR const char *cp)
            {
              if ((a < 0x100) && (b < 0x100) && (c < 0x100) && (d < 0x100))
                {
   -              result = (a << 24) | (b << 16) | (c << 8) | d;
   +              result = (((uint32_t) a) << 24) | (((uint32_t) b) << 16) |
   +                       (((uint32_t) c) << 8) | d;
                }
              break;
            }
   -- 
   2.25.1
   </pre>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org