Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. inline dont work in VC++

inline dont work in VC++

Scheduled Pinned Locked Moved Hardware & Devices
c++comtutorial
4 Posts 4 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vikas amin
    wrote on last edited by
    #1

    I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com

    T B H 3 Replies Last reply
    0
    • V vikas amin

      I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      what a C++ question do in a hardware forum Mr Amin ??? did you lost yourself into this deep deep dark website !? :omg: moreover, ,if i well remember,, this is a repost... maybe that's why you asked it here (to hope me not to see it ;P but you missed it ;) )


      TOXCCT >>> GEII power
      [toxcct][VisualCalc] -- modified at 6:15 Wednesday 30th November, 2005

      1 Reply Last reply
      0
      • V vikas amin

        I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #3

        Hello, The inline keyword is a hint to the compiler, not an absolute. The compiler still chooses best whats good for you or not.. Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

        1 Reply Last reply
        0
        • V vikas amin

          I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com

          H Offline
          H Offline
          hint_54
          wrote on last edited by
          #4

          Vikas [[]]: There are several reasons for that: 1) VC++ does not inline functions implemented in a diferent module from its declaration (at least for classes, the rest i don´t know). See this http://www.codecomments.com/archive292-2004-11-329446.html 2) Functions containing while cycles will not expand inline 3) Functions calling inline functions will not expand inline I think that´s all. Peace [[]] hint_54

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups