Q:linker options 
Author Message
 Q:linker options

I would like to determine which error messages can actually be
produced from programs that I am writting.  I have an idea that
I would like to solicite comments from this news group; here
is my idea:

I would like put an tag next to each call to the error printing
function that can be picked up with the "what" utility.

      if (Error == TRUE)
      {

         PrintError("Some Error Message");
      }

to find the errors that can be produced from an executiable, I
would just run what:

      what progname |grep "Error:"

The problem is that some functions are linked into the executiable
that will never run, and therefore I do not want errors that are
produced from functions that will never run.

If i could eliminate the functions from the executiable, I think
it would eliminate the ErrorId string also.

I am running these programs on Linux, HPUX 10.2, and AIX 4.x.

What linker options will eliminate unused functions from an executiable?

What other comments do you have on this technique?

michael potter.



Fri, 31 May 2002 03:00:00 GMT  
 Q:linker options

in comp.lang.c:

Quote:

> I would like to determine which error messages can actually be
> produced from programs that I am writting.  I have an idea that
> I would like to solicite comments from this news group; here
> is my idea:

> I would like put an tag next to each call to the error printing
> function that can be picked up with the "what" utility.

>       if (Error == TRUE)
>       {

>          PrintError("Some Error Message");
>       }

> to find the errors that can be produced from an executiable, I
> would just run what:

>       what progname |grep "Error:"

> The problem is that some functions are linked into the executiable
> that will never run, and therefore I do not want errors that are
> produced from functions that will never run.

> If i could eliminate the functions from the executiable, I think
> it would eliminate the ErrorId string also.

> I am running these programs on Linux, HPUX 10.2, and AIX 4.x.

> What linker options will eliminate unused functions from an executiable?

> What other comments do you have on this technique?

> michael potter.


Sorry, wrong newsgroup.  The C language itself does not define how
linkers operate (or even, strictly, that they exist), and is most
specifically not whether unused functions can be eliminated from the
image, or how to do so.  You will need to consult either the
documentation, or specific support groups, for the particular
compilers involved.

Jack Klein
--
Home: http://jackklein.home.att.net



Fri, 31 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Missing VC++.NET Compiler and Linker Options tab

2. linker option!

3. VC Linker Options

4. linker option: using /opt:ref with /ZI

5. VC Linker Options

6. Linker Options

7. set linker options problem

8. Linker options

9. question on Linker option /opt:ref

10. /NOE option for MS linker

11. /NOE option for MS Linker?

12. /STUB Linker Option

 

 
Powered by phpBB® Forum Software