From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2835 invoked by alias); 5 May 2002 16:04:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2821 invoked from network); 5 May 2002 16:04:20 -0000 Received: from unknown (HELO potter.sfbay.redhat.com) (205.180.83.107) by sources.redhat.com with SMTP; 5 May 2002 16:04:20 -0000 Received: from livre.redhat.lsd.ic.unicamp.br (aoliva.cipe.redhat.com [10.0.1.10]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g45G3Gv30799; Sun, 5 May 2002 09:03:16 -0700 Received: (from aoliva@localhost) by livre.redhat.lsd.ic.unicamp.br (8.11.6/8.11.6) id g45G4B018140; Sun, 5 May 2002 13:04:11 -0300 To: gdb-patches@sources.redhat.com, insight@sources.redhat.cmo Subject: multi-arched alpha won't build with OSF1 4.0d's cc From: Alexandre Oliva Organization: GCC Team, Red Hat Date: Sun, 05 May 2002 09:04:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2002-05/txt/msg00120.txt.bz2 --=-=-= Content-length: 562 OSF1 4.0d's cc complains when a non-constant value is used as the array size of a formal parameter. The first patch below fixes the problem without removing the documentation value of the array size at that point. I wonder if just commenting out the (variable) array size would be a better choice. It also rightfully refuses to compile functions containing automatic arrays of non-constant sizes. The second patch below fixes this problem. With these two patches, GDB mainline builds on this platform again, using this picky/dumb compiler. Ok to install? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=gdb-osf-cc.patch Content-length: 797 Index: gdb/ChangeLog from Alexandre Oliva * alpha-tdep.c (alpha_extract_return_value): Don't use non-constant array size in prototype. Index: gdb/alpha-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/alpha-tdep.c,v retrieving revision 1.32 diff -u -p -r1.32 alpha-tdep.c --- gdb/alpha-tdep.c 26 Apr 2002 07:05:34 -0000 1.32 +++ gdb/alpha-tdep.c 5 May 2002 15:56:51 -0000 @@ -1530,7 +1530,7 @@ alpha_breakpoint_from_pc (CORE_ADDR *pcp static void alpha_extract_return_value (struct type *valtype, - char regbuf[REGISTER_BYTES], char *valbuf) + char regbuf[ALPHA_REGISTER_BYTES], char *valbuf) { if (TYPE_CODE (valtype) == TYPE_CODE_FLT) alpha_register_convert_to_virtual (FP0_REGNUM, valtype, --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=insight-osf-cc.patch Content-length: 1200 Index: gdb/gdbtk/ChangeLog from Alexandre Oliva * generic/gdbtk-register.c (get_register, register_changed_p): Don't depend on variable-sized automatic arrays. Index: gdb/gdbtk/generic/gdbtk-register.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v retrieving revision 1.8 diff -u -p -r1.8 gdbtk-register.c --- gdb/gdbtk/generic/gdbtk-register.c 12 Apr 2002 18:18:58 -0000 1.8 +++ gdb/gdbtk/generic/gdbtk-register.c 5 May 2002 15:57:35 -0000 @@ -204,8 +204,8 @@ static void get_register (int regnum, void *fp) { struct type *reg_vtype; - char raw_buffer[MAX_REGISTER_RAW_SIZE]; - char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE); int format = (int) fp; int optim; @@ -348,7 +348,7 @@ map_arg_registers (int objc, Tcl_Obj *CO static void register_changed_p (int regnum, void *argp) { - char raw_buffer[MAX_REGISTER_RAW_SIZE]; + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); if (!frame_register_read (selected_frame, regnum, raw_buffer)) return; --=-=-= Content-length: 289 -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer --=-=-=--