GCC 4.1.1 on redhat 4.5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nano2
    New Member
    • Jan 2007
    • 41

    GCC 4.1.1 on redhat 4.5

    Hi,

    Does anyone know how Ican use inline function calls when i have optimize turned off like so -00 -ggdb so that i can have debug symbols for debugging .
    I am using gcc version 4.1.1 I have been looking on the gcc man pages and having no luck in finding the solution ...
    In order for iinline functions it needs to have -02 (optimise level switched on)

    Any one know what i could use
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by nano2
    Hi,

    Does anyone know how Ican use inline function calls when i have optimize turned off like so -00 -ggdb so that i can have debug symbols for debugging .
    I am using gcc version 4.1.1 I have been looking on the gcc man pages and having no luck in finding the solution ...
    In order for iinline functions it needs to have -02 (optimise level switched on)

    Any one know what i could use
    A quick google for "gcc optimize inline" (without quotes) reveals:
    GCC does not inline any functions when not optimizing unless you specify the always_inline attribute for the function, like this:

    /* Prototype. */
    inline void foo (const char) __attribute__(( always_inline)) ;

    Comment

    Working...