Readd lost error on local static function decls

see testcase: block scope decls for functions can't use static
(allowed is only extern or none).  This got lost in commit 85690480.
This commit is contained in:
Michael Matz
2019-12-16 06:54:18 +01:00
parent 6cb68c3a17
commit b476a5f478
3 changed files with 11 additions and 5 deletions

View File

@@ -216,14 +216,15 @@ int x[3];
|| defined test_func_2 \
|| defined test_func_3 \
|| defined test_func_4 \
|| defined test_func_5
|| defined test_func_5 \
|| defined test_func_6
#if defined test_func_1
int hello(int);
#elif defined test_func_4
static int hello(int);
#endif
int main () {
#if defined test_func_5
#if defined test_func_6
static
#endif
int hello(int);

View File

@@ -111,14 +111,17 @@ hello: a = 123
hello: a = 123
[test_func_3]
60_errors_and_warnings.c:241: warning: static storage ignored for redefinition of 'hello'
60_errors_and_warnings.c:242: warning: static storage ignored for redefinition of 'hello'
hello: a = 123
[test_func_4]
hello: a = 123
[test_func_5]
60_errors_and_warnings.c:241: error: incompatible types for redefinition of 'hello'
60_errors_and_warnings.c:242: error: incompatible types for redefinition of 'hello'
[test_func_6]
60_errors_and_warnings.c:230: error: function without file scope cannot be static
[test_var_1]
main : 1 ; 1
@@ -131,6 +134,6 @@ main : 2 ; 2
bar : 3 ; 3
[test_var_3]
60_errors_and_warnings.c:273: error: incompatible types for redefinition of 'xxx'
60_errors_and_warnings.c:274: error: incompatible types for redefinition of 'xxx'
[test_var_4]