bugGNU gettext - Bugs: bug #56132, wrong declaration of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56132: wrong declaration of libintl_version on Windows with MSYS2/mingw-w64

Submitter:  Vincent Torri <vtorri>
Submitted:  Sun 14 Apr 2019 12:09:40 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Not a Bug
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Sun 05 May 2019 07:42:14 PM UTC, comment #1: 

I have added a unit test that tests the value of libintl_version:
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=00fc06b32f41d296f54babf3b306466795cae1a3

On both Cygwin and mingw, the test passes.

This means that there is no issue. You can ignore the warnings.

Bruno Haible <haible>
Group administrator
Sun 14 Apr 2019 12:09:40 PM UTC, original submission:  

Hello

in gettext-runtime/intl/libgnuintl.h,  I see :

#if 1 && BUILDING_LIBINTL
#define LIBINTL_DLL_EXPORTED _attribute_((_visibility_("default")))
#else
#define LIBINTL_DLL_EXPORTED
#endif

and

extern LIBINTL_DLL_EXPORTED __declspec (dllimport) int libintl_version;

because of that, i have a warning when compiling the shared library :

./version.c:24:5: warning: 'libintl_version' redeclared without
dllimport attribute: previous dllimport ignored [-Wattributes]

Indeed, when compiling a DLL, the exported symbols should have the

__declspec (dllexport)

attribute and when using the DLL, the symbol should have the

__declspec (dllimport)

attribute.

With the current code, the attribute of libintl_version is always
dllimport, which is wrong.

In our project, where are using this :

#ifdef _WIN32
# ifdef EFL_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif
# else
#  define EAPI __declspec(dllimport)
# endif
#else
# ifdef _GNUC_
#  if _GNUC_ >= 4
#   define EAPI _attribute_ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

and we add EAPI in front of each exported symbols. (EFL_BUILD should
be replaced with LIBINTL_DLL_EXPORTED, and EAPI with whatever you
like). This definition of EAPI supports also the static linking of
symbols on Windows.

regards

Vincent Torri <vtorri>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by vtorri (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-05 haible StatusNone Not a Bug
        Assigned toNone haible
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code