Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-Compiler vs. Macros #16

Open
ax3l opened this issue Dec 13, 2016 · 2 comments
Open

Pre-Compiler vs. Macros #16

ax3l opened this issue Dec 13, 2016 · 2 comments

Comments

@ax3l
Copy link
Member

ax3l commented Dec 13, 2016

Regarding ComputationalRadiationPhysics/picongpu#1693 it looks odd to force #pragma calls to also start at the 0 column in a file.

#pragma, besides #pragma once, are not necessary pre-compiler instructions that make sense to be aligned that way but are non-C++-standard, extended type descriptions (attributes, no-inline, etc.) and non-C++-standard, compiler-specific compile-time hints.

@ax3l
Copy link
Member Author

ax3l commented Dec 13, 2016

Full list of actual pre-compiler commands this rule was thought for:

#include
#define
#undef
#if
#ifdef
#ifndef
#else
#elif
#endif
#error
#line
// [add more!]

@ax3l
Copy link
Member Author

ax3l commented Dec 14, 2016

offline discussion with @psychocoderHPC : accepted for the reasoning above.

For now, even if it is not a 100% correct match but simpler, our scripts will simply skip lines including a #pragma rule.
(Not all #pragma calls are compiler hints but most, e.g., only #pragma once is a pre-compiler instruction.)

PR to update this style guide is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant