cvs commit: src/lib/libc/sys tls.2

Matthew Dillon dillon at apollo.backplane.com
Mon Mar 21 13:58:01 PST 2005


    The poin is, guys, that sizeof(some_ridiculously_large_structure_or_array_
    which_is_as_large_as_the_processes_entire_address_space) is just plain
    ridiculous, and sizeof() should not have been made to return size_t
    for something so silly.  They could have added a usizeof() for the one
    in a million chance that someone actually needed something like that,
    but no... the idiots on the standard committee seem to believe that
    sizeof() is only EVER used in calls to read() or write(), verses, say,
    in generic exprssions that might, say, calculate an array index.

    for (i = 0; i < sizeof(ary)/sizeof(ary[0]); ++i) ...   now, should i
    be unsigned here, or an int?  it should be an int, plain and simple,
    for 99.99999% of the programs ever written.

    For the same reason, a TLS segment that is the size of the entire
    address space (or even 1/2 the entire address space), is also ridiculous.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Commits mailing list