public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/105845] New: Provide a name mangling facility
@ 2022-06-04  8:26 eyalroz1 at gmx dot com
  2022-06-06  8:28 ` [Bug libstdc++/105845] Provide a name mangling facility usable within C++ code de34 at live dot cn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: eyalroz1 at gmx dot com @ 2022-06-04  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105845
           Summary: Provide a name mangling facility
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eyalroz1 at gmx dot com
  Target Milestone: ---

GCC, obviously, produces mangled names for (static-storage-duration) variables
and functions when it produces object files. However, it does not expose this
functionality to programs, i.e. it doesn't let a C++ program obtain the mangled
name of a function or variable.

I'm asking that it does offer that functionality. The specifics would probably
involve some bikeshed, but for example, it could be something like this:

* In the `abi::` namespace like `__cxa_demangle()`.
* One variant of the function would mangle a string
* Another variant of the function would mangle a C++ variable or function (and
the mangling function would be templated).

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

* [Bug libstdc++/105845] Provide a name mangling facility usable within C++ code
  2022-06-04  8:26 [Bug libstdc++/105845] New: Provide a name mangling facility eyalroz1 at gmx dot com
@ 2022-06-06  8:28 ` de34 at live dot cn
  2022-06-06 12:53 ` [Bug c++/105845] " redi at gcc dot gnu.org
  2022-06-06 17:54 ` eyalroz1 at gmx dot com
  2 siblings, 0 replies; 4+ messages in thread
From: de34 at live dot cn @ 2022-06-06  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jiang An <de34 at live dot cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |de34 at live dot cn

--- Comment #1 from Jiang An <de34 at live dot cn> ---
I don't think this is a bug of libstdc++.

Perhaps you may use extern "C" and __attribute__((alias("specified_name")) (can
be also spelled as [[gnu::alias("specified_name")]] since C++11 mode) as
workaround.

See also:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html

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

* [Bug c++/105845] Provide a name mangling facility usable within C++ code
  2022-06-04  8:26 [Bug libstdc++/105845] New: Provide a name mangling facility eyalroz1 at gmx dot com
  2022-06-06  8:28 ` [Bug libstdc++/105845] Provide a name mangling facility usable within C++ code de34 at live dot cn
@ 2022-06-06 12:53 ` redi at gcc dot gnu.org
  2022-06-06 17:54 ` eyalroz1 at gmx dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-06-06 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
          Component|libstdc++                   |c++

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

* [Bug c++/105845] Provide a name mangling facility usable within C++ code
  2022-06-04  8:26 [Bug libstdc++/105845] New: Provide a name mangling facility eyalroz1 at gmx dot com
  2022-06-06  8:28 ` [Bug libstdc++/105845] Provide a name mangling facility usable within C++ code de34 at live dot cn
  2022-06-06 12:53 ` [Bug c++/105845] " redi at gcc dot gnu.org
@ 2022-06-06 17:54 ` eyalroz1 at gmx dot com
  2 siblings, 0 replies; 4+ messages in thread
From: eyalroz1 at gmx dot com @ 2022-06-06 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Eyal Rozenberg <eyalroz1 at gmx dot com> ---
(In reply to Jiang An from comment #1)
> I don't think this is a bug of libstdc++.

Well, it's not a bug, it's a feature request. But - I certainly won't bikeshed
about the choice of component.

> Perhaps you may use extern "C" and __attribute__((alias("specified_name"))
> (can be also spelled as [[gnu::alias("specified_name")]] since C++11 mode)
> as workaround.

I'm not trying to force a mangled name, I want to get the mangled name in
pre-existing code.

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

end of thread, other threads:[~2022-06-06 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-04  8:26 [Bug libstdc++/105845] New: Provide a name mangling facility eyalroz1 at gmx dot com
2022-06-06  8:28 ` [Bug libstdc++/105845] Provide a name mangling facility usable within C++ code de34 at live dot cn
2022-06-06 12:53 ` [Bug c++/105845] " redi at gcc dot gnu.org
2022-06-06 17:54 ` eyalroz1 at gmx dot com

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