built-in이 뜻하는게 무엇인가요?

jongsuknim의 이미지

warning: conflicting types for built-in function `memcmp'이런 에러가 났는데 여기서 말하는 built-in 이 무엇을 뜻하는지 모르겠습니다.

그리고 가변 인자가 어떻게 되나 신기해서 stdarg를 보았는데,
typedef __gnuc_va_list va_list;
typedef __gnuc_va_list va_list;
#define va_start(v,l) __builtin_stdarg_start((v),l)
#define va_end __builtin_va_end
#define va_arg __builtin_va_arg
이런식으로 define 정도로만 되어있고 그 이상에 다른 헤더를 include했다던가에 대한 것은 전혀 없습니다.
여기서도 보면 builtin이라는 키워드(?)가 쓰였는데, 위에서랑 같은 맥락의 의미 일까요?
혹시 컴파일러 내부적으로 만들어져있다던가...

hys545의 이미지

제가 알기로는 built_in은 내장되었다는 뜻으로 압니다
아마 그 소스 내부적으로만 사용되는게 아닌가 추정됩니다.

즐린

jj의 이미지

우리말로는 '붙박이'쯤이 되겠네요. :)

--
Life is short. damn short...

cinsk의 이미지

gcc info page를 보시면 builtin에 대한 설명이 잘 나와 있습니다.

Quote:

`-fno-builtin'
`-fno-builtin-FUNCTION'
Don't recognize built-in functions that do not begin with
`__builtin_' as prefix. *Note Other built-in functions provided
by GCC: Other Builtins, for details of the functions affected,
including those which are not built-in functions when `-ansi' or
`-std' options for strict ISO C conformance are used because they
do not have an ISO standard meaning.

GCC normally generates special code to handle certain built-in
functions more efficiently; for instance, calls to `alloca' may
become single instructions that adjust the stack directly, and
calls to `memcpy' may become inline copy loops. The resulting
code is often both smaller and faster, but since the function
calls no longer appear as such, you cannot set a breakpoint on
those calls, nor can you change the behavior of the functions by
linking with a different library.

With the `-fno-builtin-FUNCTION' option only the built-in function
FUNCTION is disabled. FUNCTION must not begin with `__builtin_'.
If a function is named this is not built-in in this version of
GCC, this option is ignored. There is no corresponding
`-fbuiltin-FUNCTION' option; if you wish to enable built-in
functions selectively when using `-fno-builtin' or
`-ffreestanding', you may define macros such as:

#define abs(n) __builtin_abs ((n))
#define strcpy(d, s) __builtin_strcpy ((d), (s))