public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
@ 2020-08-27 20:46 ` bmburstein at gmail dot com
  2022-02-15 13:17 ` redi at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: bmburstein at gmail dot com @ 2020-08-27 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

Baruch Burstein <bmburstein at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bmburstein at gmail dot com

--- Comment #2 from Baruch Burstein <bmburstein at gmail dot com> ---
This pragma is used by VSCode, too, which is commonly used with gcc as a
compiler.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
  2020-08-27 20:46 ` [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio bmburstein at gmail dot com
@ 2022-02-15 13:17 ` redi at gcc dot gnu.org
  2022-02-15 13:31 ` jakub at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-15 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |easyhack

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The docs raise some questions.

They say that a #pragma region must be ended by a #pragma endregion. Should the
compiler check that and issue a diagnostic otherwise?

What is the form of the optional "name" that follows #pragma region?

What if #pragma endregion is followed by preprocessor tokens, not just a
comment?

If we don't care about validating anything, it's easy to make GCC completely
ignore those pragmas:

--- a/gcc/c-family/c-pragma.cc
+++ b/gcc/c-family/c-pragma.cc
@@ -1218,6 +1218,15 @@ handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
            TREE_STRING_POINTER (message));
 }

+/* Ignore a no-op pragma that GCC recognizes, but which has no effect.  */
+static void
+handle_pragma_ignore (cpp_reader *)
+{
+  tree x;
+  while (pragma_lex (&x) != CPP_EOF)
+    /* Ignore the rest of the line.  */;
+}
+
 /* Mark whether the current location is valid for a STDC pragma.  */

 static bool valid_location_for_stdc_pragma;
@@ -1633,6 +1642,9 @@ init_pragma (void)
   c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options);
   c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options);

+  c_register_pragma (0, "region", handle_pragma_ignore);
+  c_register_pragma (0, "endregion", handle_pragma_ignore);
+
   c_register_pragma ("STDC", "FLOAT_CONST_DECIMAL64",
                     handle_pragma_float_const_decimal64);



This needs tests though.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
  2020-08-27 20:46 ` [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio bmburstein at gmail dot com
  2022-02-15 13:17 ` redi at gcc dot gnu.org
@ 2022-02-15 13:31 ` jakub at gcc dot gnu.org
  2022-02-15 14:02 ` austinpmorton at gmail dot com
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-15 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Exactly.  Seems clang doesn't bother with it and allows anything, but it is
unclear if that is the best thing to do.
Is name and comment just a single identifier, or any sequence of any tokens
until end of line?
And, shall the compiler verify proper nestin of these, e.g. reject
#pragma endregion
without earlier #pragma region, or
#pragma region
without termination, or whenever they aren't properly nested?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-02-15 13:31 ` jakub at gcc dot gnu.org
@ 2022-02-15 14:02 ` austinpmorton at gmail dot com
  2022-02-15 15:23 ` redi at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: austinpmorton at gmail dot com @ 2022-02-15 14:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Austin Morton <austinpmorton at gmail dot com> ---

(In reply to Jonathan Wakely from comment #3)
> The docs raise some questions.
> 
> They say that a #pragma region must be ended by a #pragma endregion. Should
> the compiler check that and issue a diagnostic otherwise?
> 
> What is the form of the optional "name" that follows #pragma region?
> 
> What if #pragma endregion is followed by preprocessor tokens, not just a
> comment?
> 
> If we don't care about validating anything, it's easy to make GCC completely
> ignore those pragmas:
> 
> --- a/gcc/c-family/c-pragma.cc
> +++ b/gcc/c-family/c-pragma.cc
> @@ -1218,6 +1218,15 @@ handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
>             TREE_STRING_POINTER (message));
>  }
>  
> +/* Ignore a no-op pragma that GCC recognizes, but which has no effect.  */
> +static void
> +handle_pragma_ignore (cpp_reader *)
> +{
> +  tree x;
> +  while (pragma_lex (&x) != CPP_EOF)
> +    /* Ignore the rest of the line.  */;
> +}
> +
>  /* Mark whether the current location is valid for a STDC pragma.  */
>  
>  static bool valid_location_for_stdc_pragma;
> @@ -1633,6 +1642,9 @@ init_pragma (void)
>    c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options);
>    c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options);
>  
> +  c_register_pragma (0, "region", handle_pragma_ignore);
> +  c_register_pragma (0, "endregion", handle_pragma_ignore);
> +
>    c_register_pragma ("STDC", "FLOAT_CONST_DECIMAL64",
>                      handle_pragma_float_const_decimal64);
>  
> 
> 
> This needs tests though.

https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553182.html

I sent a patch to do exactly that in 2020 and it was not accepted.

This seems like a very easy win.
Both major competitors to GCC (clang and MSVC) implement this pragma exactly
like in my patch (by completely ignoring it).

As it stands today, this is plainly a deficiency in GCC when compared to its
competition.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-02-15 14:02 ` austinpmorton at gmail dot com
@ 2022-02-15 15:23 ` redi at gcc dot gnu.org
  2022-02-15 15:26 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-15 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> Exactly.  Seems clang doesn't bother with it and allows anything, but it is
> unclear if that is the best thing to do.

MSVC ignores any tokens after the region/endregion as well.

> Is name and comment just a single identifier, or any sequence of any tokens
> until end of line?
> And, shall the compiler verify proper nestin of these, e.g. reject
> #pragma endregion
> without earlier #pragma region, or
> #pragma region
> without termination, or whenever they aren't properly nested?

Again, other compilers don't care:
https://godbolt.org/z/zxhYaaz9Y

So it looks like this is completely ignored by the compiler, and any logic
relating to it exists only in the editor(s).

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-02-15 15:23 ` redi at gcc dot gnu.org
@ 2022-02-15 15:26 ` jakub at gcc dot gnu.org
  2022-02-15 15:32 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-15 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I would say that is a terrible design...

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-02-15 15:26 ` jakub at gcc dot gnu.org
@ 2022-02-15 15:32 ` redi at gcc dot gnu.org
  2022-02-15 15:34 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-15 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Austin Morton from comment #5)
> https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553182.html
> 
> I sent a patch to do exactly that in 2020 and it was not accepted.

Thanks. The review thread continues in November (but the mail archive doesn't
thread it properly across months):

https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558900.html

I see what Jeff is saying, but I think the pragmatic approach here is to just
do exactly what your patch does: hardcode this warning as a no-op. We don't
have to do that for every pragma implemented by every compiler, because giving
a -Wunknown-pragmas warning about *unknown* pragmas is useful. GCC doesn't know
what the pragma was attempting to do, so it should warn.

But we do know what this one does: nothing. It's not unknown.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2022-02-15 15:32 ` redi at gcc dot gnu.org
@ 2022-02-15 15:34 ` redi at gcc dot gnu.org
  2022-02-17 11:45 ` egallager at gcc dot gnu.org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-15 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> I would say that is a terrible design...

Yes, I completely agree, but I don't see why GCC should be in the business of
diagnosing other people's junk :-)

Maybe Visual Studio's editor and VScode do have checks, just not the VC++
compiler. And if so, then that's even more reason that we don't need GCC to do
its own checking.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2022-02-15 15:34 ` redi at gcc dot gnu.org
@ 2022-02-17 11:45 ` egallager at gcc dot gnu.org
  2022-02-21 17:11 ` fw at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-02-17 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=61593
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #10 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #3)
> The docs raise some questions.
> 
> They say that a #pragma region must be ended by a #pragma endregion. Should
> the compiler check that and issue a diagnostic otherwise?
> 
> What is the form of the optional "name" that follows #pragma region?
> 
> What if #pragma endregion is followed by preprocessor tokens, not just a
> comment?
> 
> If we don't care about validating anything, it's easy to make GCC completely
> ignore those pragmas:
> 
> --- a/gcc/c-family/c-pragma.cc
> +++ b/gcc/c-family/c-pragma.cc
> @@ -1218,6 +1218,15 @@ handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
>             TREE_STRING_POINTER (message));
>  }
>  
> +/* Ignore a no-op pragma that GCC recognizes, but which has no effect.  */
> +static void
> +handle_pragma_ignore (cpp_reader *)
> +{
> +  tree x;
> +  while (pragma_lex (&x) != CPP_EOF)
> +    /* Ignore the rest of the line.  */;
> +}
> +
>  /* Mark whether the current location is valid for a STDC pragma.  */
>  
>  static bool valid_location_for_stdc_pragma;
> @@ -1633,6 +1642,9 @@ init_pragma (void)
>    c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options);
>    c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options);
>  
> +  c_register_pragma (0, "region", handle_pragma_ignore);
> +  c_register_pragma (0, "endregion", handle_pragma_ignore);
> +
>    c_register_pragma ("STDC", "FLOAT_CONST_DECIMAL64",
>                      handle_pragma_float_const_decimal64);
>  
> 
> 
> This needs tests though.

so, this seems relevant to bug 61593 too...

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2022-02-17 11:45 ` egallager at gcc dot gnu.org
@ 2022-02-21 17:11 ` fw at gcc dot gnu.org
  2022-02-25 13:01 ` rsandifo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: fw at gcc dot gnu.org @ 2022-02-21 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

Florian Weimer <fw at gcc dot gnu.org> changed:

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

--- Comment #11 from Florian Weimer <fw at gcc dot gnu.org> ---
Clang does not appear to treat this pragma as a statement. Is this also the
MSVC behavior?

int
f (int i)
{
  if (i)
#pragma region
    return 1;
#pragma endregion
  return 0;
}

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2022-02-21 17:11 ` fw at gcc dot gnu.org
@ 2022-02-25 13:01 ` rsandifo at gcc dot gnu.org
  2022-02-25 14:46 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2022-02-25 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #12 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #9)
> (In reply to Jakub Jelinek from comment #7)
> > I would say that is a terrible design...
> 
> Yes, I completely agree, but I don't see why GCC should be in the business
> of diagnosing other people's junk :-)
> 
> Maybe Visual Studio's editor and VScode do have checks, just not the VC++
> compiler. And if so, then that's even more reason that we don't need GCC to
> do its own checking.
Agreed.  And if people with strict linting requirements want
a warning about pragmas that are recognised but have no effect
on the compiler, we could still provide an option to do that
(but it shouldn't be in -Wall or even -Wextra).

That shouldn't be a requirement for this PR though, unless anyone
can show that someone somewhere really does want these pragmas to
generate a warning.

Jeff said at the end of the thread that he wouldn't mind
if someone else approves it, so it's probably worth posting
again.  The patch LGTM FWIW: only (very) minor comment is that
the unused argument name in handle_pragma_region can be dropped.

I think the patch would need to wait for GCC 13 now though.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2022-02-25 13:01 ` rsandifo at gcc dot gnu.org
@ 2022-02-25 14:46 ` redi at gcc dot gnu.org
  2022-02-25 14:49 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-25 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to rsandifo@gcc.gnu.org from comment #12)
> Jeff said at the end of the thread that he wouldn't mind
> if someone else approves it, so it's probably worth posting
> again.

OK, will do.

I think Jeff's desire for a framework to ignore arbitrary pragmas might be
nice, but nobody's going to do that, and this small improvement has a working
patch. We shouldn't let the perfect be the enemy of the good.

> The patch LGTM FWIW: only (very) minor comment is that
> the unused argument name in handle_pragma_region can be dropped.

Yeah, that was consistent with the rest of the file, but I already changed the
rest in r12-7282-g73a118c209fcbb so I'd update my patch in the same way.

I'll also update it to ignore the very similar Xcode pragmas described in PR
61593.

> I think the patch would need to wait for GCC 13 now though.

Indeed.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2022-02-25 14:46 ` redi at gcc dot gnu.org
@ 2022-02-25 14:49 ` redi at gcc dot gnu.org
  2022-05-30 15:43 ` bmburstein at gmail dot com
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-25 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Florian Weimer from comment #11)
> Clang does not appear to treat this pragma as a statement. Is this also the
> MSVC behavior?

Yes, I think so. I'll check that my patch is consistent.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (12 preceding siblings ...)
  2022-02-25 14:49 ` redi at gcc dot gnu.org
@ 2022-05-30 15:43 ` bmburstein at gmail dot com
  2022-11-11  4:28 ` cvs-commit at gcc dot gnu.org
  2022-11-11  4:28 ` redi at gcc dot gnu.org
  15 siblings, 0 replies; 16+ messages in thread
From: bmburstein at gmail dot com @ 2022-05-30 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Baruch Burstein <bmburstein at gmail dot com> ---
(In reply to Jonathan Wakely from comment #13)
> (In reply to rsandifo@gcc.gnu.org from comment #12)
>  
> > I think the patch would need to wait for GCC 13 now though.
> 
> Indeed.

Now that GCC 13 is the main development trunk, can this patch be merged? If I
understood the comments in this thread correctly, the patch already exists and
was just waiting for GCC 12 to be branched.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (13 preceding siblings ...)
  2022-05-30 15:43 ` bmburstein at gmail dot com
@ 2022-11-11  4:28 ` cvs-commit at gcc dot gnu.org
  2022-11-11  4:28 ` redi at gcc dot gnu.org
  15 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-11  4:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:d3fe767c16e7c528e4fc71c8a68ac14b4573d880

commit r13-3887-gd3fe767c16e7c528e4fc71c8a68ac14b4573d880
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 9 21:49:52 2022 +0000

    c-family: Support #pragma region/endregion [PR85487]

    These pragmas are used by some editors to mark regions of code for
    grouping and folding. GCC should silently ignore them, rather than
    giving -Wunknown-pragmas warnings.

            PR c/85487

    gcc/ChangeLog:

            * doc/cpp/pragmas.rst (Pragmas): Document region pragmas.

    gcc/c-family/ChangeLog:

            * c-pragma.cc (handle_pragma_ignore): New function.
            (init_pragma): Register region and endregion pragmas.

    gcc/testsuite/ChangeLog:

            * c-c++-common/pragma-region.c: New test.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
       [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
                   ` (14 preceding siblings ...)
  2022-11-11  4:28 ` cvs-commit at gcc dot gnu.org
@ 2022-11-11  4:28 ` redi at gcc dot gnu.org
  15 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-11  4:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Implemented for GCC 13.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-11-11  4:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
2020-08-27 20:46 ` [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio bmburstein at gmail dot com
2022-02-15 13:17 ` redi at gcc dot gnu.org
2022-02-15 13:31 ` jakub at gcc dot gnu.org
2022-02-15 14:02 ` austinpmorton at gmail dot com
2022-02-15 15:23 ` redi at gcc dot gnu.org
2022-02-15 15:26 ` jakub at gcc dot gnu.org
2022-02-15 15:32 ` redi at gcc dot gnu.org
2022-02-15 15:34 ` redi at gcc dot gnu.org
2022-02-17 11:45 ` egallager at gcc dot gnu.org
2022-02-21 17:11 ` fw at gcc dot gnu.org
2022-02-25 13:01 ` rsandifo at gcc dot gnu.org
2022-02-25 14:46 ` redi at gcc dot gnu.org
2022-02-25 14:49 ` redi at gcc dot gnu.org
2022-05-30 15:43 ` bmburstein at gmail dot com
2022-11-11  4:28 ` cvs-commit at gcc dot gnu.org
2022-11-11  4:28 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).