G
Guest
Hello,
I'm having strange issues with inline functions in VS.2003.
In following simple code snippet:
extern
int mytmp1( int v ) { return !v; };
extern int mytmp( void )
{
return mytmp1( -7 );
}
I see mytmp1 expanded inline, despite option /Ob1 (expand only __inline) iin
the project.
Is this normal? Does this depend on C or C++ mode or debug/release mode?
Another question about __inline extensions in pure C mode (MS specific, not
c++):
Are the following statements valid? All they compile clean, but I doubt
whether this can cause "undefined behavour" or is 100% legal:
A. __inline int foo1(...) { ... }
B. int __inline foo2( ... ) { ... }
C. __inline int foo3( ...); // proto
int foo3(...) {... } // separate body
D. static __inline int foo3( ...); // proto
extern int foo3(...) {... } // __inline with static or extern ??
Could somebody explain please?
Best regards,
Pavel
--
I'm having strange issues with inline functions in VS.2003.
In following simple code snippet:
extern
int mytmp1( int v ) { return !v; };
extern int mytmp( void )
{
return mytmp1( -7 );
}
I see mytmp1 expanded inline, despite option /Ob1 (expand only __inline) iin
the project.
Is this normal? Does this depend on C or C++ mode or debug/release mode?
Another question about __inline extensions in pure C mode (MS specific, not
c++):
Are the following statements valid? All they compile clean, but I doubt
whether this can cause "undefined behavour" or is 100% legal:
A. __inline int foo1(...) { ... }
B. int __inline foo2( ... ) { ... }
C. __inline int foo3( ...); // proto
int foo3(...) {... } // separate body
D. static __inline int foo3( ...); // proto
extern int foo3(...) {... } // __inline with static or extern ??
Could somebody explain please?
Best regards,
Pavel
--