public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/109704] New: #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions
@ 2023-05-02 21:11 pskocik at gmail dot com
  2023-05-02 21:15 ` [Bug preprocessor/109704] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pskocik at gmail dot com @ 2023-05-02 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109704
           Summary: #pragma {push,pop}_macro broken for identifiers that
                    contain dollar signs at nonfirst positions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pskocik at gmail dot com
  Target Milestone: ---

This following dollarsign-less example compiles fine as expected:

#define MACRO 1
_Static_assert(MACRO,"");
#pragma push_macro("MACRO")
#undef MACRO
#define MACRO 0
_Static_assert(!MACRO,"");
#pragma pop_macro("MACRO")
_Static_assert(MACRO,""); //OK


Substituting $MACRO for MACRO still works, but with MACRO$ or M$CRO the final
assertions fail: https://godbolt.org/z/n1EoGao74

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

* [Bug preprocessor/109704] #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions
  2023-05-02 21:11 [Bug preprocessor/109704] New: #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions pskocik at gmail dot com
@ 2023-05-02 21:15 ` pinskia at gcc dot gnu.org
  2023-05-02 21:17 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-02 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Well $ is an extension and MSVC does not support $, push_macro/pop_macro were
for compatibility for MSVC too.

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

* [Bug preprocessor/109704] #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions
  2023-05-02 21:11 [Bug preprocessor/109704] New: #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions pskocik at gmail dot com
  2023-05-02 21:15 ` [Bug preprocessor/109704] " pinskia at gcc dot gnu.org
@ 2023-05-02 21:17 ` pinskia at gcc dot gnu.org
  2023-06-21 15:30 ` lhyatt at gcc dot gnu.org
  2024-01-13 22:14 ` lhyatt at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-02 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Well $ is an extension and MSVC does not support $, push_macro/pop_macro
> were for compatibility for MSVC too.

Well they don't support $ in their C front-end but does in their C++ front-end.

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

* [Bug preprocessor/109704] #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions
  2023-05-02 21:11 [Bug preprocessor/109704] New: #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions pskocik at gmail dot com
  2023-05-02 21:15 ` [Bug preprocessor/109704] " pinskia at gcc dot gnu.org
  2023-05-02 21:17 ` pinskia at gcc dot gnu.org
@ 2023-06-21 15:30 ` lhyatt at gcc dot gnu.org
  2024-01-13 22:14 ` lhyatt at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: lhyatt at gcc dot gnu.org @ 2023-06-21 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:

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

--- Comment #3 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
We are also not handling UTF-8 identifiers for push_macro and pop_macro
pragmas. I was going to try to add this sometime, which would naturally handle
the case of $ as well.

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

* [Bug preprocessor/109704] #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions
  2023-05-02 21:11 [Bug preprocessor/109704] New: #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions pskocik at gmail dot com
                   ` (2 preceding siblings ...)
  2023-06-21 15:30 ` lhyatt at gcc dot gnu.org
@ 2024-01-13 22:14 ` lhyatt at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: lhyatt at gcc dot gnu.org @ 2024-01-13 22:14 UTC (permalink / raw)
  To: gcc-bugs

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

Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-13
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |patch
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2024-January
                   |                            |/642926.html

--- Comment #4 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
Patch submitted for review at
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642926.html

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

end of thread, other threads:[~2024-01-13 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 21:11 [Bug preprocessor/109704] New: #pragma {push,pop}_macro broken for identifiers that contain dollar signs at nonfirst positions pskocik at gmail dot com
2023-05-02 21:15 ` [Bug preprocessor/109704] " pinskia at gcc dot gnu.org
2023-05-02 21:17 ` pinskia at gcc dot gnu.org
2023-06-21 15:30 ` lhyatt at gcc dot gnu.org
2024-01-13 22:14 ` lhyatt 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).