aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2017-03-06 03:26:21 +0100
committerMichael Matz <matz@suse.de>2017-05-02 03:07:36 +0200
commit328b06a3fc0984b80ac94fb653ca1002bf915a4e (patch)
tree6c19ef2babf5e9fb409defc731e2baf865d89206
parent182367e232e92861be2e4734a6bf496c63389f45 (diff)
downloadtinycc-328b06a3fc0984b80ac94fb653ca1002bf915a4e.tar.gz
tinycc-328b06a3fc0984b80ac94fb653ca1002bf915a4e.tar.bz2
Extend type_to_str
to also print storage-class specifiers.
-rw-r--r--tccgen.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index 88a2bce..e34f452 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -2678,7 +2678,7 @@ static void type_to_str(char *buf, int buf_size,
char buf1[256];
const char *tstr;
- t = type->t & VT_TYPE;
+ t = type->t;
bt = t & VT_BTYPE;
buf[0] = '\0';
if (t & VT_CONSTANT)
@@ -2689,6 +2689,16 @@ static void type_to_str(char *buf, int buf_size,
pstrcat(buf, buf_size, "unsigned ");
else if (t & VT_DEFSIGN)
pstrcat(buf, buf_size, "signed ");
+ if (t & VT_EXTERN)
+ pstrcat(buf, buf_size, "extern ");
+ if (t & VT_STATIC)
+ pstrcat(buf, buf_size, "static ");
+ if (t & VT_TYPEDEF)
+ pstrcat(buf, buf_size, "typedef ");
+ if (t & VT_INLINE)
+ pstrcat(buf, buf_size, "inline ");
+ buf_size -= strlen(buf);
+ buf += strlen(buf);
switch(bt) {
case VT_VOID:
tstr = "void";