On Thu, 2021-04-22 at 00:14 +0800, Liu Hao wrote: > 在 2021-04-21 16:59, Xi Ruoyao via Gcc-help 写道: > > > > GCC is never designed to be a tool for teaching or learning. It's a > > compiler, for compiling programs in real-life. Basically -v is only > > intended to debug GCC itself. > > > > May be GCC isn't, but it *happens to*, and I think it is a good one, > because it's free software and > comes with a huge community. I remember I've seen a page in https://gcc.gnu.org/wiki showing several difficulties learning from GCC. But I can't find it now, maybe my memory is wrong or the page was removed. The problem is gcc (along with other real-world large systems) is *too* complicated. The "workarounds for strange real-world issues" are everywhere in it and those workarounds are just tricky to new learners. > > Unfortunately, while every physics teacher knows he/she shouldn't > > use a > > car to teach mechanics, many CS101 teachers keep telling the student > > "if > > you don't understand something, just do a experiment". IMO it's > > pure > > laziness. > The purpose of the topic of this thread is a bit dubious. As you have > pointed out, as a driver (not > a compiler or front-end whatsoever!), how GCC invokes other programs > (cc1, cc1plus, collect2, as, > ld, and so on) is purely implementation details, which users shouldn't > care about. But save for > that, I fail to see anything wrong with the question itself, and I > disagree with you: It is almost > always better for students to learn from their experiences, their > mistakes, their failures, rather > than textbooks. Nonetheless, there are still metaphysical things that > people can't learn from > experiences (e.g. undefined behavior). The issue of the question in OP (in the title now) is: it can be answered by just reading "man gcc", or by Google. And questions like "what do crt*.o does in detail" (in one previous post, this thread) really look like someone can't do his homework and try to get the answer here... I sincerely don't like to see someone try to "learn" by running some program containing "i = i++ + i++" and "inspect" the output. -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University