Compiler Specific Operators

Root Boy Jim rbj at icst-cmr
Sat Jul 19 03:39:02 AEST 1986


> In article <phri.2391> roy at phri.UUCP (Roy Smith) writes:
> >[Regarding compilers replacing calls to library routines with in-line code]
> >	What if you want to trap and/or trace subroutine calls for
> >diagnostic or tuning purposes...
>
> Then you're no worse off than tracing or timing portions of your own in-line 
> code.

It's not that simple. If I want to know when and from where I was called,
it would please me greatly to merely set ONE breakpoint, and not have
to track down every single call, especially if I didn't have source.
 	
> >			... or you want to supply your own version of the
> >library routine because it's faster, more accurate, or more featureful?
>
> Use a #define to a new name, or code in a new name (one of these is probably
> best), or disenable in-line expansion of code by means of a compile-time flag.

Again, lack of source may screw you. In addition, you now have to recompile
everything instead of merely relinking to replace a library routine.
While I probably willing to accept inline expansion of say, strcpy, pray
that some of these bozo vendors don't put malloc in the same bag.

Inline expansion should be optional and under control of the coder. I don't
even care if the default is expansion, and you have to work to get a real
function call. Evolution, not Revolution (see end quote) please.

A compile flag is too broad. I may want some but not all expanded inline.

> (In one of my postings I suggested that such a flag be available, but it's 
> probably not really necessary.)  Another possibility: if the compiler knew 
> about things like sin(x), then the -lm flag would not be necessary in programs
> that "call" it; thus specifying -lm could over-ride in-line expansion....

The -lm is a LOADER flag. The COMPILER may never see it, especially if
each source is compiled separately via a makefile. Besides, how does it
equate `sin()' with -lm? Look up every function in the archive? No thanks.

> Peter S. Shenkin	 Columbia Univ. Biology Dept., NY, NY  10027
> {philabs,rna}!cubsvax!peters		cubsvax!peters at columbia.ARPA

	(Root Boy) Jim Cottrell		<rbj at icst-cmr.arpa>
	Don't hit me!!  I'm in the Twilight Zone!!!

~"But if you go quoting phrases of Zippy, YOW!
  You ain't gonna make it with anyone anyhow"~



More information about the Comp.lang.c mailing list