Discussion:
where is the definition of "_builtin_va_list"
yzysea
2009-10-21 02:44:11 UTC
Permalink
Hi,

Recently, I am reading a C parser source code generated by Bison. The
underlying OS is opensolaris. However, when I use it to parse a simple C
source file, say,"Hello.c", I get the error message
"/usr/inclue/sys/va_list.h:parse error before __gnuc_va_list". As I open
this file, I find the following line "typedef __builtin_va_list
__gnuc_va_list</i>". Strangely, I couldn't find the definition of
"__builtin_va_list " even I checked all its including head files and
recursively theirs. I have been confused about it for long.

Would anyone give me some ideas about it? What is the "_builtin_va_list"
referring to? What can it be used for?
Thanks a great deal.:-((
--
View this message in context: http://www.nabble.com/where-is-the-definition-of-%22_builtin_va_list%22-tp25985646p25985646.html
Sent from the gcc - Help mailing list archive at Nabble.com.
Ian Lance Taylor
2009-10-21 05:39:55 UTC
Permalink
Post by yzysea
Recently, I am reading a C parser source code generated by Bison. The
underlying OS is opensolaris. However, when I use it to parse a simple C
source file, say,"Hello.c", I get the error message
"/usr/inclue/sys/va_list.h:parse error before __gnuc_va_list". As I open
this file, I find the following line "typedef __builtin_va_list
__gnuc_va_list</i>". Strangely, I couldn't find the definition of
"__builtin_va_list " even I checked all its including head files and
recursively theirs. I have been confused about it for long.
Would anyone give me some ideas about it? What is the "_builtin_va_list"
referring to? What can it be used for?
__builtin_va_list is automatically defined by gcc. This permits gcc
to recognize and optimize uses of va_start and friends.

Ian
yzysea
2009-10-21 05:54:43 UTC
Permalink
Post by Ian Lance Taylor
Post by yzysea
Recently, I am reading a C parser source code generated by Bison. The
underlying OS is opensolaris. However, when I use it to parse a simple C
source file, say,"Hello.c", I get the error message
"/usr/inclue/sys/va_list.h:parse error before __gnuc_va_list". As I open
this file, I find the following line "typedef __builtin_va_list
__gnuc_va_list". Strangely, I couldn't find the definition of
"__builtin_va_list " even I checked all its including head files and
recursively theirs. I have been confused about it for long.
Would anyone give me some ideas about it? What is the
"_builtin_va_list"
referring to? What can it be used for?
__builtin_va_list is automatically defined by gcc. This permits gcc
to recognize and optimize uses of va_start and friends.
Ian
Thanks for your response.
But I am wondering how a customary C parser rather than gcc to identify
"__builtin_va_list".
Any ideas?
--
View this message in context: http://www.nabble.com/where-is-the-definition-of-%22_builtin_va_list%22-tp25985646p25986862.html
Sent from the gcc - Help mailing list archive at Nabble.com.
Ian Lance Taylor
2009-10-21 14:26:24 UTC
Permalink
Post by yzysea
But I am wondering how a customary C parser rather than gcc to identify
"__builtin_va_list".
I don't really understand your question.

Some header files, including <stdarg.h>, are provided by gcc. They
use gcc internal constructs. If you want to read those header files
with a different C compiler, then you need to be prepared to read gcc
internal constructs. It doesn't make sense to prevent gcc from
assuming that only gcc will read the header files distributed with
gcc.

Ian

Loading...