This is the mail archive of the cygwin@cygwin.com 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]

strange bug : select() always generate 10022 error


Compiling with -E can give some clues.
The second case winds up producing some code like ...

do { u_int __i;for (__i = 0; __i < ((fd_set *)(&fds))->fd_count ; __i++) { if (((fd_set *)(&fds))->fd_array[__i] == ((unsigned)s)) { break; }}if (__i == ((fd_set *)(&fds))->fd_count) { if (((fd_set *)(&fds))->fd_count < 64) { ((fd_set *)(&fds))->fd_array[__i] = ((unsigned)s); ((fd_set *)(&fds))->fd_count++; }}} while(0);

while the first case produces code like ...

(__extension__ (void)({ size_t __i; char *__tmp = (char *)&fds; for (__i = 0; __i < sizeof (*(&fds)); ++__i) *__tmp++ = 0; }));

(Yes each of those are actually just one long line)

If it is really important, then you can carefully track down the
results of preprocessing in each case, and figure out what is being
superceded by what else to cause this sort of effect.

Although there are other differences, they are mainly just a name
change and its effects.

(fd_set versus _types_fd_set)

The second case also winds up referencing
       SOCKET fd_array[64];
while the first one does not;  This may be a clue.

neal


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


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