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]

cpp crashes after "macro used with just one arg"


Hi,

this is the cpp included with gcc-2.95 on i586-linux-2.2.10 (glibc
2.1.1). When fed this program

#define TEST(F,E) do { printf("%s = %" #F "\n", #E, E) } while(0)

int main()
{
  TEST(unsetenv);
}

cpp outputs
        cpp-test.c:5: macro `TEST' used with just one arg
and then crashes with a SIGSEGV.

gdb neither delivered a sensible backtrace (only that the crash
occured in chunk_free (libc?)), nor did the crash occur when stepping
through the code. If gdb is not used, the bug is completely
reproducible here.

I suspect memory corruption somewhere, perhaps near the error handling.

        Robbe

-- 
Robert Bihlmeyer       reads: Deutsch, English, MIME, Latin-1, NO SPAM!
<robbe@orcus.priv.at>    <http://stud2.tuwien.ac.at/~e9426626/sig.html>

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