|
From: | Matthew Woehlke |
Subject: | Re: coreutils 7.1.49-ebb9 FTB risc/HP-UX |
Date: | Thu, 19 Mar 2009 15:00:15 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20090105 Fedora/2.0.0.19-1.fc10 Thunderbird/2.0.0.19 Mnenhy/0.7.5.0 |
Jim Meyering wrote:
How about this instead?
D'oh, collision with the other mail I was writing. Yes, that would be fine, or you can avoid the extra values all together by shifting parentheses to make it a binary search instead of linear.
Actually my preference would be binary-search, since it avoids the "junk" enums and produces the smallest preprocessed input. (And I do think 200 kb just on figuring out the value for that enum is a bit much; that's around 4x the size of the pre-cpp source! :-) )
In case you're curious how I came up with that number (aside increasing -H until it compiled), you can verify yourself:
$ echo -e '#define MAX(a,b) (a)>(b)?(a):(b)\nMAX (O_APPEND, MAX (O_BINARY, MAX (O_CIO, MAX (O_DIRECT, MAX (O_DIRECTORY, MAX (O_DSYNC, MAX (O_NOATIME, MAX (O_NOCTTY, MAX (O_NOFOLLOW, MAX (O_NOLINKS, MAX (O_NONBLOCK, MAX (O_SYNC, MAX (O_TEXT, 0))))))))))))))' | gcc -E - | wc -c
211122$ echo -e '#define MAX(a,b) (a)>(b)?(a):(b)\nMAX( MAX( MAX (O_APPEND, MAX (O_BINARY, O_CIO)), MAX (MAX (O_DIRECT, O_DIRECTORY), MAX (O_DSYNC, O_NOATIME))), MAX (MAX (O_NOCTTY, MAX (O_NOFOLLOW, O_NOLINKS)), MAX (MAX (O_NONBLOCK, O_SYNC), MAX (O_TEXT, 0))))' | gcc -E - | wc -c
2395(So obviously I am using a slightly larger expansion of MAX, but the growth principles will be the same.)
-- Matthew Please do not quote my e-mail address unobfuscated in message bodies. -- "Two IIRC's must make a right" -- Larry Hall (paraphrased)
[Prev in Thread] | Current Thread | [Next in Thread] |