On 4/1/2016 12:55 PM, Tony Kelman wrote:
> Kai Tietz <ktietz70@...> writes:
> 
>> So I am wondering a bit, what you actual mean here?  I guessed first
>> that you were referring to the auto-import feature of ld.  As this
>> feature indeed make it unnecessary to specify dllimport attribute on
>> an external symbol.  So could you please describe your issue a bit
>> more detailed.
>>
>> Thanks,
>> Kai
> 
> Let me try to describe more specifically. If in foo.h, you do not mark
> a function with dllexport, but you do mark the implementation in foo.c
> with dllexport, GCC will compile that and it will work, but MSVC and
> Clang will error. When people make changes deciding a function needs
> to now be exported and make that change by adding the dllexport to the
> implementation, our continuous integration tests that use MinGW-w64
> show that as working. What I'm asking is whether GCC can be told to
> behave more like MSVC and Clang in this respect, causing an error when
> the header does not have dllexport but the implementation does. Make
> sense?

This has often bugged me as well.  It my google I found
https://gcc.gnu.org/wiki/Visibility which has some interesting points
but doesn't directly address this issue.  The mismatch of the header
from the function being used should at least issue a warning but I would
prefer to see an error.  The ld auto-import feature just exacerbates the
issue and when it was invented I wished for it to go away.  The idea
behind this was for ease of porting between the various systems without
needing to change the attributes of symbols or in other words a lazy
porting method.

-- 
Earnie

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to