This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sys/cdefs.h or maybe gcc build issue


On 11/8/2016 10:17 AM, Corinna Vinschen wrote:
> On Nov  1 22:29, cyg Simple wrote:
>> On 11/1/2016 3:42 PM, Ken Brown wrote:
>>> On 10/30/2016 2:23 PM, cyg Simple wrote:
>>>> The below sample code will give a warning that visibility isn't
>>>> supported in this configuration.  Either the GCC build is incorrect or
>>>> the sys/cdefs.h needs to be modified to define __hidden to empty.
>>>>
>>>> /********************************************/
>>>> #include <sys/cdefs.h>
>>>> #include <stdio.h>
>>>>
>>>> __hidden void hello (char * str) {
>>>>     printf("%s %s\n", "Hello", str);
>>>> }
>>>>
>>>> int main (int argc, char ** argv) {
>>>>     hello("cruel world!");
>>>> }
>>>> /********************************************/
>>>
>>> If you're trying to write portable code, why would you assume that
>>> __hidden is defined?  It's not defined in glibc, for example, and your
>>> sample program doesn't compile on Linux:
>>>
>>> $ gcc test.c
>>> test.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
>>> ‘void’
>>>
>>> Do you have a real use case where this issue came up?  The sample isn't
>>> very convincing as it stands.
>>
>> I don't in the real case sense but in Cygwin __hidden is defined.  And
>> obviously it is incorrectly defined in _YOUR_ Linux.  If the visibility
>> attribute isn't supported by the GCC compiler these helper macros
>> shouldn't be defined as if they were.
> 
> Fixed in the repo.
> 

Thanks, in a few months I can remove my #ifdef __CYGWIN__ to #undef and
#define it.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]