[Omake] Re: RE : Re: RE : Re: preprocessor for computing dependencies

Bárður Árantsson spam at scientician.net
Wed Sep 13 11:12:25 PDT 2006


Thomas Nagy wrote:
>> In that case one needs to instruct the build tool to
>> run whatever 
>> commands are needed to build the necessary headers
>> before scanning, I 
>> guess.
> 
> In fact, for some projects (Qt), the necessary headers
> are built after scanning.

Could you be more specific? Are you saying that qmake does this kind of 
thing, or are you saying that the build process of Qt itself does it, or...?

> 
>> Besides, what if your generated file depends
>> on other .h files? 
>> Point being: The "solution" of  outputting
>> dependencies on files which 
>> aren't known doesn't really address the fundamental
>> problem (nor can it 
>> from it's limited vantage point) whereas a build
>> system _can_.
>>
>> (I realize that a general solution to this problem
>> is not necessarily 
>> easy to achieve, but the task definitely belongs to
>> the build tool.)
>>

What, no response to this? ;)

>>> * not everyone uses gcc
>> Fair enough, but I suspect most(all?) compilers have
>> equivalent options.
> 
> You suspect, or you are certain ?

I said "I suspect", so... suspect.

> 
>>> * the gcc output is not really easy to parse
>> Easy as opposed to creating a standard-compliant
>> C/C++ preprocessor?
> 
> For guessing dependencies, yes (have a look at the
> code).
> 

"Guessing" is not good enough in my book. "Guessing" is
infinitely worse than being a bit slow. I've had it happen too often 
that some idiotic dependency-analyzing tool doesn't do it's job properly 
resulting in me (or my coworkers) chasing down bizarre bugs which would
never have existed if dependencies had been analyzed properly.

If one wants to avoid "guessing" then one has to implement a full 
standards-compliant C preprocessor; the C preprocessor makes it possible 
to generate file names to include on the fly. And that is not as easy as 
it appears at first.

> At least, the day you will realize you need to make a
> preprocessor you will have a good start point.

What's this supposed to mean? Is it some sort of dig?

> 
>>> * gcc is quite slow (not going to the system
>> includes
>>> for computing dependencies is enough in 99% of the
>>> cases)
>> Then gcc -MM is for you. :)
> 
> People in the past have told me the same thing (with
> smileys too). I still have the code for this, it is
> neither pretty (add build dirs and variants to the
> party), nor satisfactory.

What "code" are you talking about?

-- 
Bardur Arantsson
<bardurREMOVE at THISscientician.net>

- Baldrick, you wouldn't recognize a subtle plan if it painted
itself purple and danced naked on a harpsicord singing "subtle
plans are here again".
                                   Edmund Blackadder, 'Blackadder'



More information about the Omake mailing list