[ 
https://issues.apache.org/jira/browse/XERCESC-1917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837825#action_12837825
 ] 

George Gensure commented on XERCESC-1917:
-----------------------------------------

Right, I wasn't suggesting that this be applied to the 3-series, just as a very 
simple patch to get the result that you have in 3 into the 2-series (without 
having to do major surgery to remove Compilers as you've done in 3).

As far as exposing the symbols in Xerces-C++, for me its a matter of 
completeness.  Their exposure is not documented anywhere in the Xerces API (nor 
would I expect it to be), and the nature of the exposure seems hackish: these 
are derivations of standard C library routines, why would they be exposed as 
C++ mangled symbols?  These are literally the only generally callable routines 
exposed by libxerces-c.so that are not properly namespaced, and I for one don't 
like having a 3rd party library I link against silently intercepting all my 
calls to 'printf' or 'qsort', or worse yet, causing symbol lookup ambiguity 
when an undocumented symbol matches the name of one I'm trying to build later 
in my toolchain.

Anyway, long rant aside, I'll give up hopes on 2.8 if this has been frozen.  
Its the header definition in non-namespaced, non-extern "C" that's really a 
dealbreaker for me.

> GCCDefs str[n]icmp prototype and symbol exposure
> ------------------------------------------------
>
>                 Key: XERCESC-1917
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1917
>             Project: Xerces-C++
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.8.0
>         Environment: linux x86_64 gcc
>            Reporter: George Gensure
>            Priority: Minor
>
> The stricmp and strnicmp prototypes provided as a workaround for those 
> functions missing in gcc/glibc installations are defined in the global scope 
> and without extern "C" qualifiers.  As a result, these are the *only* 
> non-xerces_2_8 namespaced functions exposed by the shared library on linux.  
> I recognize that the compiler workarounds are included prior to the xercesc 
> namespace definition, and as a compromise I'd be happy to see the definitions 
> have their prototypes changed to be within an extern "C" block, as well as 
> __attribute__((visibility("hidden"))) applied to their definitions.  The 
> following diff applies cleanly to the 2.8 release and corrects my problem:
> --- src/xercesc/util/Compilers/GCCDefs.hpp
> +++ src/xercesc/util/Compilers/GCCDefs.hpp
> @@ -130,8 +130,10 @@
>  #if !defined(__CYGWIN__) && !defined(__MINGW32__)
> +extern "C" {
>  int stricmp(const char* const str1, const char* const  str2);
>  int strnicmp(const char* const str1, const char* const  str2, const unsigned 
> int count);
> +}
>  #endif // ! __CYGWIN__
> --- src/xercesc/util/Compilers/GCCDefs.cpp
> +++ src/xercesc/util/Compilers/GCCDefs.cpp
> @@ -33,11 +33,13 @@
>  #if !defined(__CYGWIN__) && !defined(__MINGW32__)
> +__attribute__((visibility("hidden")))
>  int stricmp(const char* const str1, const char* const  str2)
>  {
>   return strcasecmp(str1, str2);
>  }
> +__attribute__((visibility("hidden")))
>  int strnicmp(const char* const str1, const char* const  str2, const unsigned 
> int count)
>  {
>   if (count == 0)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to