* c-valprint.c (c_value_print): Check for plain literal `char'

target type when suppressing `(char *)' output for strings.
This commit is contained in:
Peter Schauer 1994-11-01 21:04:11 +00:00
parent e574ddd43a
commit c50e36c288
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Tue Nov 1 13:00:46 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* c-valprint.c (c_value_print): Check for plain literal `char'
target type when suppressing `(char *)' output for strings.
Mon Oct 31 19:19:51 1994 Stan Shebs (shebs@andros.cygnus.com)
* coffread.c (coff_symfile_init): Remove unused local abfd.

View File

@ -494,9 +494,9 @@ c_value_print (val, stream, format, pretty)
/* Hack: remove (char *) for char strings. Their
type is indicated by the quoted string anyway. */
if (TYPE_CODE (type) == TYPE_CODE_PTR &&
TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof(char) &&
TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT &&
!TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
TYPE_NAME (type) == NULL &&
TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL &&
STREQ (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char"))
{
/* Print nothing */
}