diff options
| author | Thomas Preud'homme <thomas.preudhomme@celest.fr> | 2010-04-13 21:08:37 +0200 |
|---|---|---|
| committer | Thomas Preud'homme <thomas.preudhomme@celest.fr> | 2010-04-15 19:33:47 +0200 |
| commit | e9406c09a3212ab3f120412a6bbdacb0cdd25deb (patch) | |
| tree | 237b1fb0eb9196a7184b118ca4444f1e68b44536 | |
| parent | 47abdbd3d52a0bf92e907c3e059b5136c140fec2 (diff) | |
| download | tinycc-e9406c09a3212ab3f120412a6bbdacb0cdd25deb.tar.gz tinycc-e9406c09a3212ab3f120412a6bbdacb0cdd25deb.tar.bz2 | |
Complain for static fct declared w/o file scope
Error out on static function without file scope and give an explaination
to the user
| -rw-r--r-- | tccgen.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2985,6 +2985,9 @@ static void post_type(CType *type, AttributeDef *ad) if (tok == '(') { /* function declaration */ + if ((type->t & VT_STATIC) && local_stack) { + error("Function without file scope cannot be static"); + } next(); l = 0; first = NULL; |
