mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 15:18:37 +08:00
Fix ARI warnings in d-exp.y
This fixes four ARI warnings found in d-exp.y. This is comprised of three uses of the && or || at the end of a line, and one use of sprintf. gdb/ChangeLog * d-exp.y (PrimaryExpression : TypeExp '.' IdentifierExp): Use xstrprintf instead of malloc and sprintf. (PrimaryExpression : IdentifierExp): Avoid operator at end of line. (lex_one_token): Likewise.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2015-08-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||||
|
|
||||||
|
* d-exp.y (PrimaryExpression : TypeExp '.' IdentifierExp): Use
|
||||||
|
xstrprintf instead of malloc and sprintf.
|
||||||
|
(PrimaryExpression : IdentifierExp): Avoid operator at end of line.
|
||||||
|
(lex_one_token): Likewise.
|
||||||
|
|
||||||
2015-08-14 Matthew Fortune <matthew.fortune@imgtec.com>
|
2015-08-14 Matthew Fortune <matthew.fortune@imgtec.com>
|
||||||
|
|
||||||
* solib-svr4.c (read_program_header): Add base_addr argument to
|
* solib-svr4.c (read_program_header): Add base_addr argument to
|
||||||
|
21
gdb/d-exp.y
21
gdb/d-exp.y
@ -475,8 +475,8 @@ PrimaryExpression:
|
|||||||
{
|
{
|
||||||
if (symbol_read_needs_frame (sym.symbol))
|
if (symbol_read_needs_frame (sym.symbol))
|
||||||
{
|
{
|
||||||
if (innermost_block == 0 ||
|
if (innermost_block == 0
|
||||||
contained_in (sym.block, innermost_block))
|
|| contained_in (sym.block, innermost_block))
|
||||||
innermost_block = sym.block;
|
innermost_block = sym.block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,8 +491,8 @@ PrimaryExpression:
|
|||||||
{
|
{
|
||||||
/* It hangs off of `this'. Must not inadvertently convert from a
|
/* It hangs off of `this'. Must not inadvertently convert from a
|
||||||
method call to data ref. */
|
method call to data ref. */
|
||||||
if (innermost_block == 0 ||
|
if (innermost_block == 0
|
||||||
contained_in (sym.block, innermost_block))
|
|| contained_in (sym.block, innermost_block))
|
||||||
innermost_block = sym.block;
|
innermost_block = sym.block;
|
||||||
write_exp_elt_opcode (pstate, OP_THIS);
|
write_exp_elt_opcode (pstate, OP_THIS);
|
||||||
write_exp_elt_opcode (pstate, OP_THIS);
|
write_exp_elt_opcode (pstate, OP_THIS);
|
||||||
@ -524,11 +524,12 @@ PrimaryExpression:
|
|||||||
struct block_symbol sym;
|
struct block_symbol sym;
|
||||||
const char *typename = TYPE_SAFE_NAME (type);
|
const char *typename = TYPE_SAFE_NAME (type);
|
||||||
int typename_len = strlen (typename);
|
int typename_len = strlen (typename);
|
||||||
char *name = malloc (typename_len + $3.length + 1);
|
char *name;
|
||||||
|
|
||||||
make_cleanup (free, name);
|
name = xstrprintf ("%.*s.%.*s",
|
||||||
sprintf (name, "%.*s.%.*s",
|
typename_len, typename,
|
||||||
typename_len, typename, $3.length, $3.ptr);
|
$3.length, $3.ptr);
|
||||||
|
make_cleanup (xfree, name);
|
||||||
|
|
||||||
sym =
|
sym =
|
||||||
lookup_symbol (name, (const struct block *) NULL,
|
lookup_symbol (name, (const struct block *) NULL,
|
||||||
@ -1207,8 +1208,8 @@ lex_one_token (struct parser_state *par_state)
|
|||||||
/* We will take any letters or digits, ignoring any embedded '_'.
|
/* We will take any letters or digits, ignoring any embedded '_'.
|
||||||
parse_number will complain if past the radix, or if L or U are
|
parse_number will complain if past the radix, or if L or U are
|
||||||
not final. */
|
not final. */
|
||||||
else if ((*p < '0' || *p > '9') && (*p != '_') &&
|
else if ((*p < '0' || *p > '9') && (*p != '_')
|
||||||
((*p < 'a' || *p > 'z') && (*p < 'A' || *p > 'Z')))
|
&& ((*p < 'a' || *p > 'z') && (*p < 'A' || *p > 'Z')))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user