Al compilar el archivo que contiene open("FILENAME", O_RDONLY);
sin -O2
marcar todo está bien. Pero cuando se enciende -O2
me sale:gcc -O2 vs. sin causas error
/usr/include/x86_64-linux-gnu/bits/fcntl2.h: In function ‘open’:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:44:7: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:45:26: error: call to ‘__open_too_many_args’ declared with attribute error: open can be called either with 2 or 3 arguments, not more
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:42:1: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:60:3: error: invalid use of ‘__builtin_va_arg_pack()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h: In function ‘open64’:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:76:7: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:77:28: error: call to ‘__open64_too_many_args’ declared with attribute error: open64 can be called either with 2 or 3 arguments, not more
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:74:1: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:92:3: error: invalid use of ‘__builtin_va_arg_pack()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h: In function ‘openat’:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:120:7: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:121:28: error: call to ‘__openat_too_many_args’ declared with attribute error: openat can be called either with 3 or 4 arguments, not more
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:118:1: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:136:3: error: invalid use of ‘__builtin_va_arg_pack()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h: In function ‘openat64’:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:154:7: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:155:30: error: call to ‘__openat64_too_many_args’ declared with attribute error: openat64 can be called either with 3 or 4 arguments, not more
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:152:1: error: invalid use of ‘__builtin_va_arg_pack_len()’
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:170:3: error: invalid use of ‘__builtin_va_arg_pack()’
Dónde puede ser el problema? Es un proyecto mixto C/C++
pero está en la parte C
. gcc 4.6.1, 3.0.0 del kernel
Editar: Resulta que commeting a aquellos línea da otro "tipo" de errores como:
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘sprintf’:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:34:3: error: invalid use of ‘__builtin_va_arg_pack()’
¿Alguna posibilidad de que pueda proporcionar un ejemplo de código mínimo pero completo que desencadene este error? – luiscubal
Extraño, ¿estás seguro de que proviene de esta línea? ¿Incluyes todo lo necesario? (para abierto y O_RDONLY) – BenjaminB
Entonces, ¿llamas 'g ++' o 'gcc'? – 0xC0000022L