From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27639 invoked by alias); 11 Jul 2009 08:25:17 -0000 Received: (qmail 27266 invoked by uid 22791); 11 Jul 2009 08:25:16 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Jul 2009 08:25:07 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6B8P59A011751 for ; Sat, 11 Jul 2009 04:25:05 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6B8P5uO011457 for ; Sat, 11 Jul 2009 04:25:05 -0400 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6B8P3iR023371 for ; Sat, 11 Jul 2009 04:25:04 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n6B8P3Eh027541 for ; Sat, 11 Jul 2009 10:25:03 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n6B8P3GX027536 for gdb-patches@sourceware.org; Sat, 11 Jul 2009 10:25:03 +0200 Date: Sat, 11 Jul 2009 08:39:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] Fix warnings using gcc-4.5 HEAD Message-ID: <20090711082502.GA18801@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00325.txt.bz2 Hi, currently GDB CVS HEAD cannot be built with gcc SVN HEAD gcc (GCC) 4.5.0 20090711 (experimental) ada-lang.c: In function ‘ada_attribute_name’: ada-lang.c:7501:9: error: comparison between ‘enum exp_opcode’ and ‘enum ada_operator’ ada-lang.c: In function ‘assign_component’: ada-lang.c:8008:30: error: comparison between ‘enum exp_opcode’ and ‘enum ada_operator’ ada-lang.c: In function ‘aggregate_assign_from_choices’: ada-lang.c:8163:14: error: comparison between ‘enum exp_opcode’ and ‘enum ada_operator’ ada-lang.c: In function ‘ada_evaluate_subexp’: ada-lang.c:8581:34: error: comparison between ‘enum exp_opcode’ and ‘enum ada_operator’ ada-lang.c:9201:13: error: comparison between ‘enum exp_opcode’ and ‘enum ada_operator’ cp-name-parser.y: In function ‘cp_comp_to_string’: cp-name-parser.y:1982:20: error: comparison between ‘enum demangle_component_type’ and ‘enum ’ cp-name-parser.y:1987:25: error: comparison between ‘enum demangle_component_type’ and ‘enum ’ dwarf2read.c: In function ‘dwarf2_name’: dwarf2read.c:8513:22: error: comparison between ‘enum dwarf_form’ and ‘enum ’ Regression tested on x86_64-fedora-linux-gnu using gcc-4.4.0-4/Fedora. Using gcc-4.5.0-20090711/SVN there are some testsuite regressions due to the built gcc target testcases - assuming not due to the built host gdb. Thanks, Jan gdb/ 2009-07-11 Jan Kratochvil Fix gcc-4.5 HEAD warnings. * ada-lang.h (enum ada_operator): Make the enum anonymous. (BINOP_IN_BOUNDS, TERNOP_IN_RANGE, OP_ATR_FIRST, OP_ATR_LAST) (OP_ATR_LENGTH, OP_ATR_IMAGE, OP_ATR_MAX, OP_ATR_MIN, OP_ATR_MODULUS) (OP_ATR_POS, OP_ATR_SIZE, OP_ATR_TAG, OP_ATR_VAL, UNOP_QUAL) (UNOP_IN_RANGE, OP_AGGREGATE, OP_OTHERS, OP_CHOICES, OP_POSITIONAL) (OP_DISCRETE_RANGE): New casted #defines. * cp-name-parser.y (GLOBAL_CONSTRUCTORS, GLOBAL_DESTRUCTORS): Replace the enum by casted #defines. * dwarf2read.c (GDB_FORM_cached_string): Likewise. --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -79,7 +79,9 @@ struct ada_opname_map /* Defined in ada-lang.c */ extern const struct ada_opname_map ada_opname_table[]; -enum ada_operator +/* Extend enum exp_opcode so that its new elements have the same type using + #defines below. */ +enum { /* X IN A'RANGE(N). N is an immediate operand, surrounded by BINOP_IN_BOUNDS before and after. A is an array, X an index @@ -87,31 +89,46 @@ enum ada_operator dimension (1-based) of A. (A multi-dimensional array type is represented as array of array of ...) */ BINOP_IN_BOUNDS = OP_EXTENDED0, +#define BINOP_IN_BOUNDS ((enum exp_opcode) BINOP_IN_BOUNDS) /* X IN L .. U. True iff L <= X <= U. */ TERNOP_IN_RANGE, +#define TERNOP_IN_RANGE ((enum exp_opcode) TERNOP_IN_RANGE) /* Ada attributes ('Foo). */ OP_ATR_FIRST, +#define OP_ATR_FIRST ((enum exp_opcode) OP_ATR_FIRST) OP_ATR_LAST, +#define OP_ATR_LAST ((enum exp_opcode) OP_ATR_LAST) OP_ATR_LENGTH, +#define OP_ATR_LENGTH ((enum exp_opcode) OP_ATR_LENGTH) OP_ATR_IMAGE, +#define OP_ATR_IMAGE ((enum exp_opcode) OP_ATR_IMAGE) OP_ATR_MAX, +#define OP_ATR_MAX ((enum exp_opcode) OP_ATR_MAX) OP_ATR_MIN, +#define OP_ATR_MIN ((enum exp_opcode) OP_ATR_MIN) OP_ATR_MODULUS, +#define OP_ATR_MODULUS ((enum exp_opcode) OP_ATR_MODULUS) OP_ATR_POS, +#define OP_ATR_POS ((enum exp_opcode) OP_ATR_POS) OP_ATR_SIZE, +#define OP_ATR_SIZE ((enum exp_opcode) OP_ATR_SIZE) OP_ATR_TAG, +#define OP_ATR_TAG ((enum exp_opcode) OP_ATR_TAG) OP_ATR_VAL, +#define OP_ATR_VAL ((enum exp_opcode) OP_ATR_VAL) /* Ada type qualification. It is encoded as for UNOP_CAST, above, and denotes the TYPE'(EXPR) construct. */ UNOP_QUAL, +#define UNOP_QUAL ((enum exp_opcode) UNOP_QUAL) /* X IN TYPE. The `TYPE' argument is immediate, with UNOP_IN_RANGE before and after it. True iff X is a member of type TYPE (typically a subrange). */ UNOP_IN_RANGE, +#define UNOP_IN_RANGE ((enum exp_opcode) UNOP_IN_RANGE) /* An aggregate. A single immediate operand, N>0, gives the number of component specifications that follow. The @@ -122,9 +139,11 @@ enum ada_operator positional aggregates only). Aggregates currently occur only as the right sides of assignments. */ OP_AGGREGATE, +#define OP_AGGREGATE ((enum exp_opcode) OP_AGGREGATE) /* An others clause. Followed by a single expression. */ OP_OTHERS, +#define OP_OTHERS ((enum exp_opcode) OP_OTHERS) /* An aggregate component association. A single immediate operand, N, gives the number of choices that follow. This is followed by a second @@ -150,16 +169,19 @@ enum ada_operator who can work around the problem in any case by putting parentheses around X. */ OP_CHOICES, +#define OP_CHOICES ((enum exp_opcode) OP_CHOICES) /* A positional aggregate component association. The operator is followed by a single integer indicating the position in the aggregate (0-based), followed by a second OP_POSITIONAL. Next follows a single expression giving the component value. */ OP_POSITIONAL, +#define OP_POSITIONAL ((enum exp_opcode) OP_POSITIONAL) /* A range of values. Followed by two expressions giving the upper and lower bounds of the range. */ - OP_DISCRETE_RANGE, + OP_DISCRETE_RANGE, +#define OP_DISCRETE_RANGE ((enum exp_opcode) OP_DISCRETE_RANGE) /* End marker */ OP_ADA_LAST --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -316,10 +316,8 @@ make_name (const char *name, int len) %token GLOBAL %{ -enum { - GLOBAL_CONSTRUCTORS = DEMANGLE_COMPONENT_LITERAL + 20, - GLOBAL_DESTRUCTORS = DEMANGLE_COMPONENT_LITERAL + 21 -}; +#define GLOBAL_CONSTRUCTORS (DEMANGLE_COMPONENT_LITERAL + 20) +#define GLOBAL_DESTRUCTORS (DEMANGLE_COMPONENT_LITERAL + 21) %} /* Precedence declarations. */ --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -501,14 +501,11 @@ struct attr_abbrev ENUM_BITFIELD(dwarf_form) form : 16; }; -/* Additional GDB-specific attribute forms. */ -enum - { - /* A string which has been updated to GDB's internal - representation (e.g. converted to canonical form) and does not - need to be updated again. */ - GDB_FORM_cached_string = 0xff - }; +/* Additional GDB-specific attribute form: + + A string which has been updated to GDB's internal representation (e.g. + converted to canonical form) and does not need to be updated again. */ +#define GDB_FORM_cached_string ((enum dwarf_form) 0xff) /* Attributes have a name and a value */ struct attribute