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)


> > Of course it's not defined behaviour in C99, since it's unspecified 
> > whether inlining will take place for any given function -- and hence 
> > anything that depends on inlining occuring is then by definition 
> > incorrect.  As soon as you make inlining mandatory, these questions start 
> > to rear their heads.
> 
> Are you sure this is the right exegesis? I would have thought that this was improper
> on entirely different grounds (e.g. that if you remove the inline completely it is
> still improper).

That's not relevant.  We know the code is incorrect if you never inline.  
The question is whether the code is correct if you always inline.

c99 doesn't have to worry about that situation; since there is no way of 
forcing inline behaviour in the standard then the code must be incorrect.

If we want to allow mandatory inlining then we have to decide whether the 
example is legal or not.  If we decide that it's legal, then we had better 
have a test to ensure we do it correctly.

R.


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