pragma auto_inline(off) incorrect operation?

E

Eero Pajarre

I just noticed that in .NET 2003 the pragma auto_inline does not
behave as I think it should. I am expecting it to disable automatic
function inlining when compiling on /Ob2 or similar optimisation.
Instead it also seems to disable all (?) function inlining.

I am pretty sure the VC++ 6.0 version did not behave like this.


Eero

(I know that the inline is unnecessary in my example, but I also tried
using it)


example:
-------------

#pragma auto_inline(off)

class test1{
int x_v;
public:
inline test1():x_v(0){}

inline int x()const{return x_v;}
};


int main(int argc, char* argv[])
{
test1 a;
return a.x();
}
--------------
 
D

David Lowndes

I just noticed that in .NET 2003 the pragma auto_inline does not
behave as I think it should. I am expecting it to disable automatic
function inlining when compiling on /Ob2 or similar optimisation.
Instead it also seems to disable all (?) function inlining.

Given your example it would seem to be working contrary to the
documentation.

I'll try to point this out to MS.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top