From mboxrd@z Thu Jan 1 00:00:00 1970 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) To: randolph@tausq.org Cc: gdb-patches@sources.redhat.com Subject: Re: [commited] small changes to fix hpux-cc compile Date: Sun, 16 May 2004 15:55:00 -0000 Message-id: <20040516155532.8F75E4B104@berman.michael-chastain.com> X-SW-Source: 2004-05/msg00468.html > Yes, this was indeed my thinking and why i hardcoded it. So what happens if your hardcoded auto array of size 4 ever overflows? We get a nasty bit of stack corruption. I hate seeing code like this creep into gdb. It works until something else changes and then it quietly crashes or prints random bad results. The reason this code stopped compiling is that TARGET_INT_BIT became more dynamic; it changed from a manifest constant to a function call. char dld_flags_buffer[4]; ... status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT); That's just wrong! Michael C