diff options
author | Per Bothner <per@bothner.com> | 1992-07-10 23:30:40 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1992-07-10 23:30:40 +0000 |
commit | a252e71520d278556602ac1ef01c51c6f53d5d3d (patch) | |
tree | 35e7d8d03e4eb60a5408947731cf0b238e3464a7 /gdb/c-exp.y | |
parent | 8b2c227584adb445a6095ec64625bfdb290487ed (diff) | |
download | gdb-a252e71520d278556602ac1ef01c51c6f53d5d3d.zip gdb-a252e71520d278556602ac1ef01c51c6f53d5d3d.tar.gz gdb-a252e71520d278556602ac1ef01c51c6f53d5d3d.tar.bz2 |
* gdbtypes.c, gdbtypes.h: New function lookup_signed_typename.
* c-exp.y: Call lookup_signed_typename() after seeing
"signed". This handles "signed char" correctly.
* c-exp.y: Recognize (but ignore) 'const' and 'volatile'
keywords before a type specifier.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 793b769..fa8ebb9 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -161,7 +161,7 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *)); /* Special type cases, put in to allow the parser to distinguish different legal basetypes. */ -%token SIGNED_KEYWORD LONG SHORT INT_KEYWORD +%token SIGNED_KEYWORD LONG SHORT INT_KEYWORD CONST_KEYWORD VOLATILE_KEYWORD %token <lval> LAST REGNAME @@ -834,6 +834,9 @@ type : ptype { $$ = lookup_member_type (lookup_function_type ($1), $3); free ((PTR)$8); } + /* "const" and "volatile" are curently ignored. */ + | CONST_KEYWORD type { $$ = $2; } + | VOLATILE_KEYWORD type { $$ = $2; } ; typebase @@ -878,7 +881,7 @@ typebase | UNSIGNED { $$ = builtin_type_unsigned_int; } | SIGNED_KEYWORD typename - { $$ = $2.type; } + { $$ = lookup_signed_typename (TYPE_NAME($2.type)); } | SIGNED_KEYWORD { $$ = builtin_type_int; } | TEMPLATE name '<' type '>' @@ -1359,6 +1362,8 @@ yylex () if (current_language->la_language == language_cplus && !strncmp (tokstart, "template", 8)) return TEMPLATE; + if (!strncmp (tokstart, "volatile", 8)) + return VOLATILE_KEYWORD; break; case 6: if (!strncmp (tokstart, "struct", 6)) @@ -1376,6 +1381,8 @@ yylex () return UNION; if (!strncmp (tokstart, "short", 5)) return SHORT; + if (!strncmp (tokstart, "const", 5)) + return CONST_KEYWORD; break; case 4: if (!strncmp (tokstart, "enum", 4)) |