mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-23 19:23:02 +00:00
bison: pacify Sun C 5.12
* src/scan-code.l (show_sub_message): Redo initializations to work around a bogus Sun C 5.12 warning. (parse_ref): Remove unreachable code that Sun C 5.12 complains about. * src/uniqstr.h (uniqstr_vsprintf): Use _GL_ATTRIBUTE_FORMAT_PRINTF (...) instead of __attribute__ ((__format__ (__printf__, ...))). Otherwise, Sun C 5.12 complains about an unknown attribute.
This commit is contained in:
@@ -342,8 +342,19 @@ show_sub_message (warnings warning,
|
|||||||
{
|
{
|
||||||
static struct obstack msg_buf;
|
static struct obstack msg_buf;
|
||||||
const char *tail = explicit_bracketing ? "" : cp + strlen (var->id);
|
const char *tail = explicit_bracketing ? "" : cp + strlen (var->id);
|
||||||
const char *id = var->hidden_by ? var->hidden_by->id : var->id;
|
const char *id;
|
||||||
location id_loc = var->hidden_by ? var->hidden_by->loc : var->loc;
|
location id_loc;
|
||||||
|
|
||||||
|
if (var->hidden_by)
|
||||||
|
{
|
||||||
|
id = var->hidden_by->id;
|
||||||
|
id_loc = var->hidden_by->loc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
id = var->id;
|
||||||
|
id_loc = var->loc;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create the explanation message. */
|
/* Create the explanation message. */
|
||||||
obstack_init (&msg_buf);
|
obstack_init (&msg_buf);
|
||||||
@@ -573,9 +584,6 @@ parse_ref (char *cp, symbol_list *rule, int rule_length,
|
|||||||
return INVALID_REF;
|
return INVALID_REF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not reachable. */
|
|
||||||
return INVALID_REF;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keeps track of the maximum number of semantic values to the left of
|
/* Keeps track of the maximum number of semantic values to the left of
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#ifndef UNIQSTR_H_
|
#ifndef UNIQSTR_H_
|
||||||
# define UNIQSTR_H_
|
# define UNIQSTR_H_
|
||||||
|
|
||||||
|
# include <stdio.h>
|
||||||
|
|
||||||
/*-----------------------------------------.
|
/*-----------------------------------------.
|
||||||
| Pointers to unique copies of C strings. |
|
| Pointers to unique copies of C strings. |
|
||||||
`-----------------------------------------*/
|
`-----------------------------------------*/
|
||||||
@@ -33,7 +35,7 @@ uniqstr uniqstr_new (char const *str);
|
|||||||
strings, use UNIQSTR_CONCAT, which is a convenient wrapper around
|
strings, use UNIQSTR_CONCAT, which is a convenient wrapper around
|
||||||
this function. */
|
this function. */
|
||||||
uniqstr uniqstr_vsprintf (char const *format, ...)
|
uniqstr uniqstr_vsprintf (char const *format, ...)
|
||||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
_GL_ATTRIBUTE_FORMAT_PRINTF (1, 2);
|
||||||
|
|
||||||
/* Two uniqstr values have the same value iff they are the same. */
|
/* Two uniqstr values have the same value iff they are the same. */
|
||||||
# define UNIQSTR_EQ(Ustr1, Ustr2) (!!((Ustr1) == (Ustr2)))
|
# define UNIQSTR_EQ(Ustr1, Ustr2) (!!((Ustr1) == (Ustr2)))
|
||||||
|
|||||||
Reference in New Issue
Block a user