public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/111100] New: Use extern "C" for __gcov_dump and related functions in gcov.h
@ 2023-08-22 10:36 carlosgalvezp at gmail dot com
  2023-08-22 12:54 ` [Bug gcov-profile/111100] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: carlosgalvezp at gmail dot com @ 2023-08-22 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111100
           Summary: Use extern "C" for __gcov_dump and related functions
                    in gcov.h
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: carlosgalvezp at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Hi!

The documentation of GCOV mentions that users can use __gcov_dump and
__gcov_reset. This comes from gcov.h.

The problem is that we currently can't use them in C++ code, because they don't
have extern "C" declaration. Therefore the names are mangled which leads to
linking errors (undefined reference) when using the code.

As a workaround, people need to re-create gcov.h on their own to add the extern
"C" declaration, or include the header under an extern "C" block, which is not
very clean.

Would it be possible to add extern "C" to the declarations in gcov.h?

Thanks

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

* [Bug gcov-profile/111100] Use extern "C" for __gcov_dump and related functions in gcov.h
  2023-08-22 10:36 [Bug gcov-profile/111100] New: Use extern "C" for __gcov_dump and related functions in gcov.h carlosgalvezp at gmail dot com
@ 2023-08-22 12:54 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-22 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-08-22

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think so, yes.  Confirmed.

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

end of thread, other threads:[~2023-08-22 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22 10:36 [Bug gcov-profile/111100] New: Use extern "C" for __gcov_dump and related functions in gcov.h carlosgalvezp at gmail dot com
2023-08-22 12:54 ` [Bug gcov-profile/111100] " rguenth 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).