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/04/24 11:55:22 UTC

[GitHub] [incubator-nuttx] cmorganBE opened a new issue #858: Would a PR to switch to '#pragma once' be accepted?

cmorganBE opened a new issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858


   Would switch the #ifdef, #define, #endif entries to a single #pragma once at the top of each header file. #pragma once is widely supported at this point.


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



[GitHub] [incubator-nuttx] patacongo commented on issue #858: Would a PR to switch to '#pragma once' be accepted?

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858#issuecomment-618983653


   Very bad idea.
   


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



[GitHub] [incubator-nuttx] cmorganBE commented on issue #858: Would a PR to switch to '#pragma once' be accepted?

Posted by GitBox <gi...@apache.org>.
cmorganBE commented on issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858#issuecomment-618980097


   @xiaoxiang781216 just seeing a lot of complex header protection defines that someone has to put together (or script) that would go away.
   
   @patacongo I appreciate that, normally I wouldn't advocate for a pragma as they are compiler implementation specific. It's too bad that it hasn't made its way into the language standard proper yet. It's been supported by basically all compilers for a dozen years now.
   
   If, at some point, an exception would be made for this particular pragma, let me know!


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



[GitHub] [incubator-nuttx] patacongo commented on issue #858: Would a PR to switch to '#pragma once' be accepted?

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858#issuecomment-618983536


   No worth it.  There is no real benefit and a very, very big downside.  We must not introduce ANY compiler dependencies in the source code.  We have followed that rule for a dozen years and it will not change now..  Let's not consider this.


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



[GitHub] [incubator-nuttx] patacongo edited a comment on issue #858: Would a PR to switch to '#pragma once' be accepted?

Posted by GitBox <gi...@apache.org>.
patacongo edited a comment on issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858#issuecomment-618983653


   Very bad idea.  There is ABSOLUTELY not good reason to do this other than your personal preference which does not carry any weight in this.
   


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



[GitHub] [incubator-nuttx] patacongo commented on issue #858: Would a PR to switch to '#pragma once' be accepted?

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858#issuecomment-618976315


   No compiler dependencies are permitted directly anywhere in .c or .h files.  #pragma may not be used there.
   
   Compiler dependencies may be "indirectly" used if they are added to included/nuttx/compiler.h and a comon definition is provided for all tools.  But even that use is discouraged.  The OS should not, in general, depend on any property of any toolchain.
   
   So, please, do not consider adding #pragma to any source files.


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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on issue #858: Would a PR to switch to '#pragma once' be accepted?

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #858:
URL: https://github.com/apache/incubator-nuttx/issues/858#issuecomment-618967665


   I think it's hard to use this since:
   1.NuttX need comatablie with C89 standard
   2.#pragma once isn't defined in C standard
   I also don't see the benefit to switch #ifndef/#define/#endif to #pragma once, do you have any particular reason?


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