This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
> I'm not trying to be unreasonable. I'm just saying that if there is a > function that is marked inline that can be inlined, it _should_ be > inlined, because the compiler _never_ knows better than the programmer. Er, the compiler often knows better than the programmer. That is why we use compilers - to free us from low-level and architecture-dependent decisions. Note you have a rather atypical perspective. You know the hardware in depth, and you know which instruction sequences will be faster. You probably know (or at least can make an informed guess) if inline will help or hinder the code. You also sometimes need precise control over low-level code. We cannot design a compiler for the Linux Torvalds' of the world. We have to do what is best for *most* programmers, while still providing the needed tools for the experts. I really don't understand your objection to -Winline, optionally combined with -Werror. It seems to give you pretty close to what you need: A good-faith effort from the compiler to inline when you ask it to, plus a warning or error when it cannot. What more can the compiler possibly do? Are you saying the compiler should also obey "register" directives, because the programmer knows better? --Per Bothner Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner