This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/5091: variables qualified volatile of type va_list will cause a segmentation fault
- From: rodrigc at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, maierkom at rcs dot ei dot tum dot de, nobody at gcc dot gnu dot org
- Date: 13 Dec 2001 04:28:14 -0000
- Subject: Re: c/5091: variables qualified volatile of type va_list will cause a segmentation fault
Synopsis: variables qualified volatile of type va_list will cause a segmentation fault
State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Wed Dec 12 20:28:14 2001
State-Changed-Why:
I can reproduce your segfault.
I don't think you are doing a very safe thing by
defining a volatile va_list. va_list is usually a macro
which expands to a compiler, platform, and architecture
specific thing. So messing around with va_list is not
safe.
If I compile your code with g++ instead of gcc, I get the
following errors:
varargtest.c: In function `void foo(char*, ...)':
varargtest.c:10: could not convert `ap' to `void*&'
<internal>:10: in passing argument 1 of `void __builtin_stdarg_start(void*&,
...)'
varargtest.c:27: could not convert `ap' to `void*&'
<internal>:27: in passing argument 1 of `void __builtin_va_end(void*&)
If I were you, I would try to change my code generator
or generated code.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5091&database=gcc