This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]