bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-classpath] [Bug classpath/23185] New: TARGET_NATIVE_FILE_AVAILABLE


From: robilad at kaffe dot org
Subject: [bug-classpath] [Bug classpath/23185] New: TARGET_NATIVE_FILE_AVAILABLE broken for select case
Date: 1 Aug 2005 21:22:16 -0000

from native/target/generic/target_generic_file.h:


    460   #elif defined(HAVE_SELECT)
    461     #include <string.h>
    462     #include <sys/select.h>
    463     #define TARGET_NATIVE_FILE_AVAILABLE(filedescriptor,length,result) \
    464       do { \
    465         fd_set         __filedescriptset; \
    466         struct timeval __timeval; \
    467         \
    468         length=0; \
    469         \
    470         FD_ZERO(&__filedescriptset); \
    471         FD_SET(filedescriptor,&__filedescriptset); \
    472         memset(&__timeval,0,sizeof(__timeval)); \
    473         switch
(select(filedescriptor+1,&__filedescriptset,NULL,NULL,&__timeval)==0) \
    474         { \
    475           case -1: result=TARGET_NATIVE_ERROR; break; \
    476           case  0: length=JNI_JLONG_CONST_0; result=TARGET_NATIVE_OK;
break; \
    477           default: length=JNI_JLONG_CONST_1; result=TARGET_NATIVE_OK;
break; \
    478         } \
    479       } while (0)

the switch is nicely broken since the check for equality with 0 violates the law
of the excluded middle. See 
http://mathworld.wolfram.com/LawoftheExcludedMiddle.html

furthermore, there is no such thing as JNI_LONG_CONST_0 or JNI_JLONG_CONST_1;
these days the constants are called TARGET_NATIVE_MATH_INT_INT64_CONST_0 and
TARGET_NATIVE_MATH_INT_INT64_CONST_1, respectively.

fixing this for kaffe atm, a fix should be incoming for Classpath as well.

cheers,
dalibor topic

-- 
           Summary: TARGET_NATIVE_FILE_AVAILABLE broken for select case
           Product: classpath
           Version: 0.17
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: classpath
        AssignedTo: robilad at kaffe dot org
        ReportedBy: robilad at kaffe dot org
                CC: bug-classpath at gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23185




reply via email to

[Prev in Thread] Current Thread [Next in Thread]