Better HN
topnewbestaskshowjobs
Log inSign up

fstd

1 karma · joined Jan 5, 2017 (9y ago) · 3 submissions

Submissions

comment 9y ago · link · parent

Can't believe they're running on Windows. Yikes.

comment 9y ago · link · parent

Before each call to select, you'll have to FD_ZERO the fd set(s), then individually FD_SET each fd you're interested in.

If that's a large number of fds, then that's quite some overhead.

comment 9y ago · link · parent

if P does not point to valid memory, then dereferencing it is UB. Therefore, the compiler is at liberty to do whatever it wants (whether or not that is a good idea is irrelevant for the purposes of this consideration).

If the compiler knows that this is undefined, then you have already broken your end of the deal and therefore the compiler is free to break their end of the deal.

Therefore, eliminating the line is completely okay and the only think broken there is the code.