From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F8F43858002; Tue, 23 Mar 2021 21:48:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F8F43858002 From: "aladjev.andrew at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/99741] New: dllexport attribute is not compatible with c99 inline Date: Tue, 23 Mar 2021 21:48:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aladjev.andrew at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 21:48:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99741 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=3D50466&action=3Dedit 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/606bd6dcc547cf2f9fd7387321db794= 19bf60041. GCC ignores only dllimport attribute, but fails with dllexport attribute. Please review simplified project: a1.h, a1.c, a2.c and CMakeLists.txt attac= hed. You can try to build it on windows using: CC=3D"gcc" cmake -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=3D1 . && make CC=3D"clang" cmake -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=3D1 . && ma= ke GCC provides error: multiple definition of func. I can't understand the rea= son of this error: maybe dllexport converted C99 inline declaration into C89? Workaround for this issue is to remove dllexport attribute for windows plat= form + gcc on makefile generator layer (cmake/etc). PS this issue is indirectly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90161=