* [commit][obv] Remove dead code and reformat function prototype on parsers
@ 2012-01-16 22:31 Sergio Durigan Junior
2012-01-17 1:08 ` [obv] Fix m2-exp.y compilation error Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: Sergio Durigan Junior @ 2012-01-16 22:31 UTC (permalink / raw)
To: gdb-patches
Hi,
This has been discussed at
http://sourceware.org/ml/gdb-patches/2012-01/msg00567.html. I committed
the following patch.
http://sourceware.org/ml/gdb-cvs/2012-01/msg00143.html
Thanks.
Sergio.
2012-01-16 Sergio Durigan Junior <sergiodj@redhat.com>
* f-exp.y (parse_number): Convert prototype from K&R to ANSI C.
(growbuf_by_size): Likewise.
(yyerror): Likewise.
* m2-exp.y (make_qualname): Remove function (was #if 0'ed).
(modblock): Remove variable (was #if 0'ed).
(parse_number): Convert prototype from K&R to ANSI C.
(yyerror): Likewise.
* objc-exp.y (parse_number): Likewise.
(yyerror): Likewise.
(yylex): Remove #if 0'ed code.
* p-exp.y (uptok): Convert prototype from K&R to ANSI C.
(yyerror): Likewise.
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index fa464cf..b258c0a 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -664,11 +664,7 @@ name_not_typename : NAME
/*** Needs some error checking for the float case ***/
static int
-parse_number (p, len, parsed_float, putithere)
- char *p;
- int len;
- int parsed_float;
- YYSTYPE *putithere;
+parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
{
LONGEST n = 0;
LONGEST prevn = 0;
@@ -895,8 +891,7 @@ static int tempbufindex; /* Current index into buffer */
first one on demand. */
static void
-growbuf_by_size (count)
- int count;
+growbuf_by_size (int count)
{
int growby;
@@ -1217,8 +1212,7 @@ yylex (void)
}
void
-yyerror (msg)
- char *msg;
+yyerror (char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index ef9ec8e..af6c400 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -113,21 +113,11 @@ static int yylex (void);
void yyerror (char *);
-#if 0
-static char *make_qualname (char *, char *);
-#endif
-
static int parse_number (int);
/* The sign of the number being parsed. */
static int number_sign = 1;
-/* The block that the module specified by the qualifer on an identifer is
- contained in, */
-#if 0
-static struct block *modblock=0;
-#endif
-
%}
/* Although the yacc "value" of an expression is not used,
@@ -665,8 +655,7 @@ type
/*** Needs some error checking for the float case ***/
static int
-parse_number (olen)
- int olen;
+parse_number (int olen)
{
char *p = lexptr;
LONGEST n = 0;
@@ -1076,22 +1065,8 @@ yylex (void)
}
}
-#if 0 /* Unused */
-static char *
-make_qualname(mod,ident)
- char *mod, *ident;
-{
- char *new = malloc(strlen(mod)+strlen(ident)+2);
-
- strcpy(new,mod);
- strcat(new,".");
- strcat(new,ident);
- return new;
-}
-#endif /* 0 */
-
void
-yyerror (msg)
+yyerror (char *msg)
char *msg;
{
if (prev_lexptr)
diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y
index b43ba66..68b2a97 100644
--- a/gdb/objc-exp.y
+++ b/gdb/objc-exp.y
@@ -992,11 +992,7 @@ name_not_typename : NAME
/*** Needs some error checking for the float case. ***/
static int
-parse_number (p, len, parsed_float, putithere)
- char *p;
- int len;
- int parsed_float;
- YYSTYPE *putithere;
+parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
{
/* FIXME: Shouldn't these be unsigned? We don't deal with negative
values here, and we do kind of silly things like cast to
@@ -1419,9 +1415,6 @@ yylex (void)
case '^':
case '~':
case '!':
-#if 0
- case '@': /* Moved out below. */
-#endif
case '<':
case '>':
case '[':
@@ -1783,8 +1776,7 @@ yylex (void)
}
void
-yyerror (msg)
- char *msg;
+yyerror (char *msg)
{
if (*lexptr == '\0')
error(_("A %s near end of expression."), (msg ? msg : "error"));
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 7b05d58..4be3e6e 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1093,9 +1093,8 @@ static const struct token tokentab2[] =
/* Allocate uppercased var: */
/* make an uppercased copy of tokstart. */
-static char * uptok (tokstart, namelen)
- char *tokstart;
- int namelen;
+static char *
+uptok (char *tokstart, int namelen)
{
int i;
char *uptokstart = (char *)malloc(namelen+1);
@@ -1732,8 +1731,7 @@ yylex (void)
}
void
-yyerror (msg)
- char *msg;
+yyerror (char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [obv] Fix m2-exp.y compilation error
2012-01-16 22:31 [commit][obv] Remove dead code and reformat function prototype on parsers Sergio Durigan Junior
@ 2012-01-17 1:08 ` Jan Kratochvil
2012-01-17 6:18 ` Sergio Durigan Junior
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2012-01-17 1:08 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: gdb-patches
Hi Sergio,
On Mon, 16 Jan 2012 22:06:46 +0100, Sergio Durigan Junior wrote:
> --- a/gdb/m2-exp.y
> +++ b/gdb/m2-exp.y
[...]
> void
> -yyerror (msg)
> +yyerror (char *msg)
> char *msg;
> {
> if (prev_lexptr)
m2-exp.y: In function ‘m2_error’:
m2-exp.y:1069:1: error: old-style parameter declarations in prototyped function definition
Recommending to always build the tree before/after a check-in.
Checked in the typo fix.
Regards,
Jan
http://sourceware.org/ml/gdb-cvs/2012-01/msg00146.html
--- src/gdb/ChangeLog 2012/01/16 21:03:36 1.13741
+++ src/gdb/ChangeLog 2012/01/17 00:06:45 1.13742
@@ -1,3 +1,8 @@
+2012-01-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix compilation error.
+ * m2-exp.y (yyerror): Use ANSI C prototype.
+
2012-01-16 Sergio Durigan Junior <sergiodj@redhat.com>
* f-exp.y (parse_number): Convert prototype from K&R to ANSI C.
--- src/gdb/m2-exp.y 2012/01/16 21:03:36 1.38
+++ src/gdb/m2-exp.y 2012/01/17 00:06:47 1.39
@@ -1067,7 +1067,6 @@
void
yyerror (char *msg)
- char *msg;
{
if (prev_lexptr)
lexptr = prev_lexptr;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [obv] Fix m2-exp.y compilation error
2012-01-17 1:08 ` [obv] Fix m2-exp.y compilation error Jan Kratochvil
@ 2012-01-17 6:18 ` Sergio Durigan Junior
0 siblings, 0 replies; 3+ messages in thread
From: Sergio Durigan Junior @ 2012-01-17 6:18 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Monday, January 16 2012, Jan Kratochvil wrote:
> On Mon, 16 Jan 2012 22:06:46 +0100, Sergio Durigan Junior wrote:
>> --- a/gdb/m2-exp.y
>> +++ b/gdb/m2-exp.y
> [...]
>> void
>> -yyerror (msg)
>> +yyerror (char *msg)
>> char *msg;
>> {
>> if (prev_lexptr)
>
> m2-exp.y: In function ‘m2_error’:
> m2-exp.y:1069:1: error: old-style parameter declarations in prototyped function definition
>
> Recommending to always build the tree before/after a check-in.
Sorry, I had this patch lying around but should have rebuilt it anyway.
Thank you for the fix.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-17 2:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 22:31 [commit][obv] Remove dead code and reformat function prototype on parsers Sergio Durigan Junior
2012-01-17 1:08 ` [obv] Fix m2-exp.y compilation error Jan Kratochvil
2012-01-17 6:18 ` Sergio Durigan Junior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox