Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Examples of current platforms/architectures where sizeof(void*) > Date: Thu, 9 Sep 2021 13:05:48 +1200 Lines: 53 Message-ID: References: <3a825e94-940c-49c5-990a-554a6bcc35a4n@googlegroups.com> <_XsXI.31292$o45.12466@fx46.iad> <87a6kuhchx.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net DpzE01yAPpYg8ghjJaZyHgWrITmkVghh9FGw+3IzAjKKNZ8VC8 Cancel-Lock: sha1:08refKZhKha6hqMvBC8Jj5xvWaQ= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.c++:81108 On 09/09/2021 12:27, Bart wrote: > On 09/09/2021 00:06, Ian Collins wrote: >> On 09/09/2021 00:31, Bart wrote: >>> >>> You don't need to go as far as having one source file (although that's >>> what I do when a project needs to be built elsewhere). But not having >>> them spread around 100 nested directories would help! >>> >>> As for recompiling everything: you need to do that anyway when you >>> download a project in source form and want to turn it into an executable. >>> >>> Here, the hoops normally needed to define dependencies between modules >>> and to allow incremental builds are not necessary. >> >> Your projects, no surprise, are ideally suited to your way of working. >> Large cross platform projects with scores or geographically distributed >> developers are a different fish kettle.  Most significant open source >> and propitiatory projects fall into that category.  Even our little >> embedded product has 2600+ source and 4500+ header files.  Combining >> those would probably take longer than building them! > > Have you tried it? Nope. > I've just downloaded the sources of the GMP project that has been > discussed, from github. > > There are about 960 .c and .h files in all (not including any that may > be synthesised when building, but including files specific to many > different targets). > > Extracting all those files from the directory structure, into a single > file, took my script 0.6 seconds. > > That 5MB file contained 173K lines of code, which is not huge. (The 5 > language projects of mine that I'd posted about, coincidentally also > totalled 173K lines of code; and also coincidentally took 0.6 seconds to > build into 5 executables.) So what happens if you get an error at line 16,789? How do you map that back to the original source? It's much easier to combine C files than it is to combine C++ where there's often a fair bit of code in the headers. Even if it were feasible to combine all of the files, the resulting TU would probably break the compiler on a machine with a reasonable amount of RAM. Even it it could be compiled, it would take an age on a single core. -- Ian.