This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -fobey-inline (was Re: gcc and inlining)


> No, it's a compile my buggy program issue.

That's too harsh, a program that does not follow the letter of the standard may
still be perfectly valid for a given implementation, just not portable, but the
programmer may not care about portable, and may care very much whether or not a
given implementation behaves or does not behave in a particular manner.

Yes, implementors can stand on their pedastals and read the standard, and are 
entitled to do so. But potential users are also entititled to take their marbles
and go elsewhere. You have to strike a balance.

Example: Fortran-66 was carefully designed to allow the use of an Algol-60 style
stack for local variables (in particular, if you set a local variable on exit
from a procedure (e.g. a boolean First_Time_In variable) you cannot according to
the standard expect it to be set that way on the next call.

BUT, in practice all Fortran compilers used static allocation, so much so that this
was considered the "right" way of doing things. Burroughs was certainly technically
correct vis-a-vis the standard when they used a stack implementation, but virtually
all Fortran (I should write FORTRAN for 66 :-) users found their compiler useless.

There are many reasons why people would want to force the compiler to obey inlining,
and yes, they are outside the standard, but that does not necessarily make them
illegitimate. For example in GNAT we respect pragma Inline_Always (a pragma we
added for GNAT, it's not in the standard), because it is useful in various
circumstances (e.g. for avoiding this use of a runtime library in a certified
environment).

Robert Dewar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]