From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!linus!linus!linus!mbunix!eachus From: eachus@largo.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: Use pragma INLINE or not? Message-ID: Date: 19 Jun 91 15:15:50 GMT References: <1991Jun18.171459.11744@software.org> Sender: news@linus.mitre.org (News Service) Organization: The Mitre Corp., Bedford, MA. In-Reply-To: stluka@neptune.software.org's message of 18 Jun 91 17:14:59 GMT Nntp-Posting-Host: largo.mitre.org List-Id: In article <1991Jun18.171459.11744@software.org> stluka@neptune.software.org (Fred Stluka) writes: About the use of pragma INLINE...There seem to be 2 schools of thought, what do you think? Pragmas are supposed to be advice to the compiler, and a good compiler should NOT ingnore that advice. But there are actually two separate cases, and I get frustrated by compilers which try to "help" me when it is inappropriate. If a procedure or function call is internal to the unit which defines that subprogram, compilers should inline when obviously beneficial, and inline in all cases if the programmer requests it. (Yes, that includes subprograms which may call themselves directly or indirectly, inline the original call and generate explicit call where necessary for recursion. In cases of indirect recursion, a programmer can use pragma INLINE to help the compiler decide where explicit calls should be put.) However when a call is to a subprogram exported by another library unit, a compiler should not inline absent an explicit pragma, since the programmer may not want the extra dependencies created. My usual style is to put a commented out pragma INLINEs in the package specs if I want inlining in the final version, and remove the comments only for major builds or for a final version. A compiler option to ignore pragma INLINE would be nice, but very tricky to implement usefully except on a per library basis. As it is, the uncommenting is just one of many automatic steps in the process of doing a build. -- Robert I. Eachus with STANDARD_DISCLAIMER; use STANDARD_DISCLAIMER; function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...