On 08/05/2011 04:25 PM, Eric Blake wrote:
> What if we go with the array approach, but without risking
> overallocation problems?
Well again, it depends on what the test is for.
My impression is that a good deal of code wants PATH_MAX
because it wants to create an array of size
PATH_MAX. If that's what we're testing for, then
the char array is the more-appropriate test.
If all we want to test is whether PATH_MAX is an integer
constant expression, never mind the value, then
I'd suggest something like "enum { foo = 0 * PATH_MAX };".
(PATH_MAX / PATH_MAX doesn't work if PATH_MAX is zero.)