summaryrefslogtreecommitdiff
path: root/miniany/cc.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2021-08-20 08:48:14 +0000
committerAndreas Baumann <mail@andreasbaumann.cc>2021-08-20 08:48:14 +0000
commit1a6b63ad270d09ece8a520e64235ba8d8017ed22 (patch)
treef6c30564de52f1e9c5268944c242ab655b825c5f /miniany/cc.c
parentb74b9a8ef45137611e53e779d932d9d222e8eb35 (diff)
downloadcompilertests-1a6b63ad270d09ece8a520e64235ba8d8017ed22.tar.gz
compilertests-1a6b63ad270d09ece8a520e64235ba8d8017ed22.tar.bz2
c4: fixed compiler warnings and using old style block comments
Diffstat (limited to 'miniany/cc.c')
-rw-r--r--miniany/cc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/miniany/cc.c b/miniany/cc.c
index d77def0..fc253b1 100644
--- a/miniany/cc.c
+++ b/miniany/cc.c
@@ -290,7 +290,7 @@ struct Symbol *createSymbol( char *s )
struct Symbol *sym;
sym = (struct Symbol *)malloc( sizeof ( struct Symbol ) );
- sym->name = strdup( s );
+ sym->name = (char *)strdup( s );
sym->next = NULL;
return sym;
@@ -340,13 +340,15 @@ int main( int argc, char **argv )
pushback = 0;
DEBUG_SCANNER = 1;
symbol = NULL;
- ident = "12345678901234567890";
+ ident = (char *)malloc( MAX_IDENT_LEN+1 );
token = getToken( );
while( token != S_EOI ) {
parseStatement( );
}
+ free( (char *)ident );
+
exit( EXIT_SUCCESS );
return EXIT_SUCCESS;