This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] Suppress sign-conversion warning from FD_SET


  +extern unsigned long int __fdelt_chk (long int __d);
  +extern unsigned long int __fdelt_warn (long int __d)

Shouldn't these functions return the same type
that they accept?

-  ({ unsigned long int __d = (d);					    \
+  ({ long int __d = (d);						    \
      (__builtin_constant_p (__d)					    \
       ? (__d >= __FD_SETSIZE						    \

This should check for __d < 0 as well.
Or, to make it clearer, you might write it this way:

    (0 <= d && d < __FD_SETSIZE
     ? __d / __NFDBITS
     : __fdelt_warn (__d))


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