From: Angus L. <le...@ly...> - 2005-09-30 22:35:58
|
Keith MARSHALL wrote: > Angus Leeming wrote: > >>(As for the (void)foo; --- well I guess whether you need it >>depends on the warning levels you're using on your compiler >>and whether you've set warning == fatal. I don't think you >>should assume too much :)) > > > I've assumed only that `WIN32_FILE_ATTRIBUTE_DATA foo;' is a > syntactically invalid statement, which it will be if including > windows.h hasn't caused the macro to be defined. This will > *always* produce an error, not a warning, in gcc. > > Even if windows.h defines this macro to be an empty string, gcc > will report a "foo:undefined symbol" error, and fail the test. > > Only if windows.h provides a definition which makes the statement > syntactically valid, will the test pass. Do you know of any case > where this will pass, when you believe it should fail? If so, is > merely adding an additional `(void)foo;' sufficient to promote > the failure? Hmmmm. I was thinking of things the other way around. Ie, I do have access to the WIN32_FILE_ATTRIBUTE_DATA declaration but I'm got my compiler set up to be pedantic in the extreme. Ie, the test would pass but the "variable is unused" warning issued by the compiler is sufficient to cause it to fail because I have it set to "warning == failure". It's the sort of little detail that you do tend to see in generated tests, so I guess the autoconf people have been bitten by it in the past. Regards, Angus |