Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22296

How GCC handles built-in function

$
0
0

I have trouble understanding GCC built-in functions, and feel very confused.

  • What is the difference between a library function and an built-in function?

  • Is there something a built-in function can do but a library function cannot?

  • Can I write a library function that performs the same task as the built-in function printf? How can I tell the type of the input parameters (%f, float or double)?

  • Machine instructions of GCC built-in functions are not stored in a library, right? Where are they?

  • When doing linking, how can you control where to put these built-in function codes?

  • Why sometimes I can error messages like "undefined reference to __builtin_stdarg_start" when doing linking

    // main.c
    #include <stdio.h>
    int main(void) {
      printf("hello world!\n");
      return 0;
    }
    

    gcc -c main.c, nm shows that there is no symbol printf in main.o, (only main(T) and puts(U)) , why?


Viewing all articles
Browse latest Browse all 22296

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>