https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66298

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I believe there is no general consistency in the indentation of pragmas, some
projects never indent them, others put them at the same level as the previous
stmt, others at the same level as the next stmt.
To catch the
if (1)
  #pragma GCC diagnostics ...
  something;
we just should have a separate warning that warns if the body of an
if/else/while/for is a pragma handled as a statement.
Note, for OpenMP, this is covered by the standard and GCC already errors on
OpenMP standalone directives in such contexts, so you get an error for
if (1)
  #pragma omp flush
  something;
where flush is standalone directive, but not for
if (1)
  #pragma omp single
  something;
where single is not standalone directive and has associated non-pragma code.

Reply via email to