public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99741] New: dllexport attribute is not compatible with c99 inline
@ 2021-03-23 21:48 aladjev.andrew at gmail dot com
  2021-03-23 21:53 ` [Bug c/99741] " aladjev.andrew at gmail dot com
  2023-12-04 10:16 ` [Bug target/99741] " egallager at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: aladjev.andrew at gmail dot com @ 2021-03-23 21:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99741
           Summary: dllexport attribute is not compatible with c99 inline
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aladjev.andrew at gmail dot com
  Target Milestone: ---

Created attachment 50466
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50466&action=edit
fit.tar.gz

Hello, please review the following cmake issue here
https://gitlab.kitware.com/cmake/cmake/-/issues/21940#note_925715.

I am trying to create cross platform application, than I need to compile it
using MSVC. MSVC requires mandatory dllexport and dllimport attributes for all
functions including C99 inline functions. Clang is completely ignoring these
attributes in GNU env and it is always successful
https://github.com/llvm/llvm-project/commit/606bd6dcc547cf2f9fd7387321db79419bf60041.
GCC ignores only dllimport attribute, but fails with dllexport attribute.

Please review simplified project: a1.h, a1.c, a2.c and CMakeLists.txt attached.
You can try to build it on windows using:

CC="gcc" cmake -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=1 . && make
CC="clang" cmake -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=1 . && make

GCC provides error: multiple definition of func. I can't understand the reason
of this error: maybe dllexport converted C99 inline declaration into C89?

Workaround for this issue is to remove dllexport attribute for windows platform
+ gcc on makefile generator layer (cmake/etc).

PS this issue is indirectly related to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90161

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

* [Bug c/99741] dllexport attribute is not compatible with c99 inline
  2021-03-23 21:48 [Bug c/99741] New: dllexport attribute is not compatible with c99 inline aladjev.andrew at gmail dot com
@ 2021-03-23 21:53 ` aladjev.andrew at gmail dot com
  2023-12-04 10:16 ` [Bug target/99741] " egallager at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: aladjev.andrew at gmail dot com @ 2021-03-23 21:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Aladjev <aladjev.andrew at gmail dot com> ---
PS https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89088 is another issue that may
be related to this one.

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

* [Bug target/99741] dllexport attribute is not compatible with c99 inline
  2021-03-23 21:48 [Bug c/99741] New: dllexport attribute is not compatible with c99 inline aladjev.andrew at gmail dot com
  2021-03-23 21:53 ` [Bug c/99741] " aladjev.andrew at gmail dot com
@ 2023-12-04 10:16 ` egallager at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: egallager at gcc dot gnu.org @ 2023-12-04 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|https://gcc.gnu.org/bugzill |https://gcc.gnu.org/bugzill
                   |a/show_bug.cgi?id=90161     |a/show_bug.cgi?id=99901

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Andrew Aladjev from comment #0)
> PS this issue is indirectly related to
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90161

That has been closed as a dup of bug 99901, which has since been closed as
fixed.

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

end of thread, other threads:[~2023-12-04 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 21:48 [Bug c/99741] New: dllexport attribute is not compatible with c99 inline aladjev.andrew at gmail dot com
2021-03-23 21:53 ` [Bug c/99741] " aladjev.andrew at gmail dot com
2023-12-04 10:16 ` [Bug target/99741] " egallager 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).