This is the mail archive of the gcc-bugs@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]

-Wwritestrings affects exceptions


I'm sending this again, because the nature of the bug was misunderstood by
some.


#include <stdio.h>

> int main(void)
{
    try
    {
         throw "b";
    }
    catch (char * e)
    {
        fprintf(stderr, "%s\n", e);
    }
    return 0;
}


If -Wwritestrings is specified, this works correctly, and the exception is
NOT caught.

If -Wwritestrings is NOT specified, the exception is caught.

If a const is added to the catch, it catches properly in both cases.


Sparc Ultra-2, egcs-1.0.3a.


James W. McKelvey
mckelvey@solstice.jpl.nasa.gov




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