473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

forcing compiler to consider inline function inline.

Hi all,
I want to force that compiler take the function INLINE if i declare it
inline.I know there is some macro to force the compiler to take the
function as inline..but unfortunately i dont know the name.Please tell
if there is any other way to do so if you know.
Thanks in advance. Ajay

Mar 30 '06 #1
5 1408
Ajay posted:
Hi all,
I want to force that compiler take the function INLINE if i declare it
inline.I know there is some macro to force the compiler to take the
function as inline..but unfortunately i dont know the name.Please tell
if there is any other way to do so if you know.
Thanks in advance. Ajay


Something like:

__forceinline
-Tomás
Mar 30 '06 #2

Tomás wrote:
Ajay posted:
Hi all,
I want to force that compiler take the function INLINE if i declare it
inline.I know there is some macro to force the compiler to take the
function as inline..but unfortunately i dont know the name.Please tell
if there is any other way to do so if you know.
Thanks in advance. Ajay


Something like:

__forceinline
-Tomás

Have you used it yourself.?Are you sure.??Please reply fast.thank you.

Mar 30 '06 #3
Ajay posted:

Tomás wrote:
Ajay posted:
> Hi all,
> I want to force that compiler take the function INLINE if i declare it > inline.I know there is some macro to force the compiler to take the
> function as inline..but unfortunately i dont know the name.Please tell > if there is any other way to do so if you know.
> Thanks in advance. Ajay
>
>


Something like:

__forceinline
-Tomás

Have you used it yourself.?Are you sure.??Please reply fast.thank you.


Never used it myself, but I vaguely remember seeing something like it in
a compiler's helpbook.

Note that it's a compiler extension, it's nothing to do with the C++
programming language.
-Tomás
Mar 30 '06 #4

Tomás wrote:
Ajay posted:

Tomás wrote:
Ajay posted:

> Hi all,
> I want to force that compiler take the function INLINE if i declare it > inline.I know there is some macro to force the compiler to take the
> function as inline..but unfortunately i dont know the name.Please tell > if there is any other way to do so if you know.
> Thanks in advance. Ajay
>
>

Something like:

__forceinline
-Tomás

Have you used it yourself.?Are you sure.??Please reply fast.thank you.


Never used it myself, but I vaguely remember seeing something like it in
a compiler's helpbook.

Note that it's a compiler extension, it's nothing to do with the C++
programming language.


Indeed there is _no_ way to do it in standard C++ so, to the OP: you
will need to look in your compiler documentation or ask a group
dedicated to your compiler because the answer, if there is one, is
likely to be different depending on what compiler you are using.

Gavin Deane

Mar 30 '06 #5
Ajay wrote:
Hi all,
I want to force that compiler take the function INLINE if i declare it
inline.I know there is some macro to force the compiler to take the
function as inline..but unfortunately i dont know the name.Please tell
if there is any other way to do so if you know.
Thanks in advance. Ajay


The C++ language definition says that inline is a hint to the compiler
(as to inlining itself; it also has some semantic consequences).
Anything else is compiler-specific, and is best discussed in a
compiler-specific newsgroup.

--

Pete Becker
Roundhouse Consulting, Ltd.
Apr 1 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Michael Gaab | last post by:
How would I force the compiler to throw an error for the following: function signature - void foo(short); function call - foo('d'); My compiler does not complain when I call foo() with a...
14
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
3
by: Dave | last post by:
Hi everyone, Is it possible, using an Attribute or by some other means, to notify the C# Compiler to serialize all static field's that have initializers before code in an explicit static...
5
by: Ondrej Spanel | last post by:
I though that inline functions should be always visible only in the compilation unit where they are defined - meaning if compiler cannot inline them, they should be handled as if declared static....
2
by: Michael Stembera | last post by:
Here is a very simple piece of code to repro this bug. template<typename T, int N> inline bool foo( void ) { return true; } template<typename T> inline bool foo<T, 1>( void ) { return...
40
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what...
10
by: Lynn McGuire | last post by:
Is there anyway to force code to be inline other than making that code a macro ? We have about 100 lines of code that is duplicated using a macro in about a dozen places. We would rather make...
3
by: Joe Van Dyk | last post by:
I'm compiling some code on a IRIX compiler (MIPSpro Compilers: Version 7.4.2m) with all warnings turned on, and I'm getting some of these warnings: cc-3649 CC: ERROR at end of source all...
9
by: Christof Warlich | last post by:
Hi, consider this: template<typename Tclass X { public: void doSomething(T t); }; int main(void) { X<intx;
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.