[ 
https://issues.apache.org/jira/browse/THRIFT-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14958123#comment-14958123
 ] 

Nobuaki Sukegawa commented on THRIFT-3370:
------------------------------------------

We can just remove those 2 lines IMO.
Given the discussion, I don't see any possibility where anyone needs to 
re-enable it in the future.

"man errno" does provide an idea behind the extern declaration but strongly 
discourages it too.

{quote}
It was common in traditional C to declare errno manually (i.e., extern int 
errno) instead of including <errno.h>.  *Do not do this*.  It will not work 
with modern versions of the C library.
{quote}

If you're unsure about the type of errno, we can safely assume it's a plain int:
the defined expression is dereferencing an int pointer returned by __errno() 
function call.


> errno extern variable redefined. Not compiling in Android
> ---------------------------------------------------------
>
>                 Key: THRIFT-3370
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3370
>             Project: Thrift
>          Issue Type: Bug
>          Components: C glib - Library
>    Affects Versions: 0.9.3
>            Reporter: Gonzalo Aguilar
>              Labels: build, c, easyfix
>
> It seems that the definition of errno we are using on the c_glib transport is 
> not 100% correct. While it's ok for ISO C99 compilers it fails under Android. 
> My opinion is that Android is behaving incorrectly here but I cannot be sure 
> until I check with you. 
> In the thrift_socket.c an thrift_server_socket.c implementations there's a 
> errno variable declared.
> /* for errors coming from socket() and connect() */
> extern int errno;
> This variable is redefined in the ndk of the in the file 
> arch-arm/usr/include/errno.h 
> I don't know why. 
> /* a macro expanding to the errno l-value */
> #define  errno   (*__errno())
> So the compilation fails because redefined. 
> Commenting out the extern definition on these files it compiles, it was 
> tested and it works. But I don't know how this can work since the definition 
> of errno on the files change from int to pointer. 
> Can someone comment this please?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to