static functions

G

grid

Hi,
Does the below statement hold true always/mostly :
Use of "static" suppresses the generation of function bodies for
uncalled functions, including those for which all calls have been
inlined !!

Thanks,
 
M

Michal Nazarewicz

grid said:
Does the below statement hold true always/mostly :
Use of "static" suppresses the generation of function bodies for
uncalled functions, including those for which all calls have been
inlined !!

Probably true if optimization is turned on in compiler. If a static
function was not called there is no use for it since it cannot be
called from outside of the file ("the file" may be invalid term here).
 
M

Michal Nazarewicz

Michal Nazarewicz said:
Probably true if optimization is turned on in compiler. If a static
function was not called there is no use for it since it cannot be
called from outside of the file ("the file" may be invalid term here).

Of course also providing that the address of the function was not
taken.
 
?

=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

grid said:
Hi,
Does the below statement hold true always/mostly :
Use of "static" suppresses the generation of function bodies for
uncalled functions, including those for which all calls have been
inlined !!

I don't have access to the documentation of your compiler, so I can't
tell you.

The C language does not guarantee such a thing though.
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top