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 2023/01/15 18:28:41 UTC

[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

xiaoxiang781216 opened a new pull request, #8121:
URL: https://github.com/apache/nuttx/pull/8121

   ## Summary
   
   to avoid the compiler warning
   
   ## Impact
   
   xtensa
   
   ## Testing
   
   Pass CI


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1404923383

   Ok, I move them to xcc section, @pkarashchenko 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1398105755

   @xiaoxiang781216 could you please point me to some good article describing atomic variables and accessing it? I need to educate myself as I was not expecting `atomic_load` to be used with `atomic_int`, but was expecting simple `priv->refs == 1` if `refs` is `atomic_int`.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] gustavonihei commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1396982709

   I honestly feel that adding this flag to this broad scope is too overkill, even because the occurrence is not even in upstream code. And this is a kind of warning that shouldn't be overlooked.
   
   Considering the motivation of bypassing a possible false positive from Clang, I would suggest to reduce the scope of this flag to the minimum possible.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1404855640

   Maybe that disabling can be done selectively only for Clang?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1404854580

   Seems to be the same as https://github.com/RIOT-OS/RIOT/issues/12048


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko merged pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko merged PR #8121:
URL: https://github.com/apache/nuttx/pull/8121


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1396564883

   > @xiaoxiang781216 Could you please share the motivation for disabling this warning? In which scenario does it manifest?
   
   @gustavonihei here is the warning generated by Candance's clang:
   ```
   [2023-01-19T07:31:49.594Z] media_proxy.c:498:9: error: large atomic operation may incur significant performance penalty [-Werror,-Watomic-alignment]
   [2023-01-19T07:31:49.594Z]     if (atomic_load(&priv->refs) == 1 && priv->socket) {
   [2023-01-19T07:31:49.594Z]         ^
   ```
   
   Here is the related struct definition:
   ```
   typedef struct MediaProxyPriv {
       void                  *proxy;
       char                  *cpu;
       uint64_t              handle;
       atomic_int            refs;
       int                   socket;
       void                  *cookie;
       media_event_callback  event;
   } MediaProxyPriv;
   ```
   The warning looks wrong since refs should be naturally alignment.
   
   > 
   > From this Clang patchset, this warning seems useful: https://reviews.llvm.org/D45319
   > 
   > > If an atomic variable is misaligned Clang will emit accesses to it as a libcall. These calls are likely to be slow and involve locks; they are almost certainly not what the developer intended.
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1398489955

   Here https://en.cppreference.com/w/c/atomic/atomic_load


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] gustavonihei commented on pull request #8121: arch:xtensa:toolchain: add -Wno-atmoic-alignment flags

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on PR #8121:
URL: https://github.com/apache/nuttx/pull/8121#issuecomment-1384022937

   @xiaoxiang781216 Could you please share the motivation for disabling this warning? In which scenario does it manifest?
   
   From this Clang patchset, this warning seems useful:
   https://reviews.llvm.org/D45319


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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