On Fri, 20 Oct 2006 20:30:35 GMT,
(Roland Pibinger)
wrote:
>On Fri, 20 Oct 2006 19:47:42 +0000 (UTC), Walter Roberson wrote:
>>including a particular file can end up changing the meaning of
>>something else, but the code might compile fine without it.
>>
>>For example, you might have an include file that contained
>>
>> #define _use_search_heuristics 1
>>
>>Then the code might have
>>
>> #if defined(_use_search_heuristics)
>> /* do it one way */
>> #else
>> /* do it a different way */
>> #endif
>>
>>where the code is valid either way.
>
>You are right in theory. But that kind of include file dependencies
>(include order dependencies) is usally considered bad style.
No, he's right in practice. There's no guarantee that a body of
existing code will conform to your (or anyone's) rules of good style.
>
>>Thus in order to test whether any particular #include is really
>>needed by checking the compile results, you need to analyze the
>>compiled object, strip out symbol tables and debug information and
>>compile timestamps and so on, and compare the generated code.
>
>IMO, this is overdone. You have to test your application after code
>changes anyway.
>
>Best regards,
>Roland Pibinger
--
Al Balmer
Sun City, AZ