c/5091: variables qualified volatile of type va_list will cause a segmentation fault
rodrigc@gcc.gnu.org
rodrigc@gcc.gnu.org
Wed Dec 12 20:36:00 GMT 2001
The following reply was made to PR c/5091; it has been noted by GNATS.
From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
maierkom@rcs.ei.tum.de, nobody@gcc.gnu.org
Cc:
Subject: Re: c/5091: variables qualified volatile of type va_list will cause a segmentation fault
Date: 13 Dec 2001 04:28:14 -0000
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
More information about the Gcc-prs
mailing list