Re: Examples of current platforms/architectures where sizeof(void*) >
James Kuyper <[email protected]> Thu, 9 Sep 2021 12:40:13 -0400
| Newsgroups | alt.books.pratchett |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
On 9/9/21 12:13 PM, [email protected] wrote: > On Thu, 9 Sep 2021 14:47:12 +0300 > Paavo Helde <[email protected]> wrote: >> 09.09.2021 11:54 [email protected] kirjutas: >>> On Wed, 8 Sep 2021 20:22:52 +0300 >>> Paavo Helde <[email protected]> wrote: >>>> 08.09.2021 13:24 [email protected] kirjutas: >>>>> >>>>> You can write a makefile just as simple. However what happens when you >>>>> want foo.c recompiled when foo.h and bar.h changes but bar.c should only >>>>> be recompiled when bar.h and moo.h change, moo.c should only be recompiled >>>> when >>>>> moo.h changes and main.c should be recompiled when anything changes? >>>>> >>>> >>>> Such dependencies are taken care automatically by the gcc -MD option, >>> >>> No unless the compiler is clairvoyant they arn't. >> >> I am sure Clairvoyant is happy if somebody pays them $$ for features >> which other people have enjoyed for free for decades. > > No, they haven't, because the compiler has no idea which files to rebuild if > it doesn't know what those files are. The build system knows, the compiler > doesn't. A C compiler is supposed to replace a #include directive with the contents of the specified file - if it doesn't know what file that is, how can a compiler perform that replacement? If it does know what file that is, it can record that dependency for use in later runs, which is precisely what gcc -MD does. Most compilers I'm familiar with also invoke the linker themselves, and therefore know precisely which files they told the linker to link together. They also use information provided by the linker to determine which library files the linker ended up linking into the program.