From 7deaeb2a056c1756ce6f2550d2ebb91b81b9ff29 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 7 Feb 2022 15:28:35 -0500 Subject: [PATCH] Use functions with prototypes when appropriate; NFC A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the fourth batch of tests being updated (there are a significant number of other tests left to be updated). --- clang/test/Parser/CompoundStmtScope.c | 2 +- clang/test/Parser/MicrosoftExtensions.c | 10 ++--- clang/test/Parser/altivec-non-type-vector.c | 4 +- clang/test/Parser/altivec-typedef-vector.c | 2 +- clang/test/Parser/altivec.c | 6 +-- clang/test/Parser/asm.c | 8 ++-- clang/test/Parser/atomic.c | 6 +-- clang/test/Parser/attr-availability.c | 26 +++++------ clang/test/Parser/attr-external-source-symbol.m | 52 +++++++++++----------- clang/test/Parser/attributes.c | 6 +-- clang/test/Parser/bad-control.c | 8 ++-- clang/test/Parser/block-block-storageclass.c | 2 +- clang/test/Parser/brackets.c | 6 +-- clang/test/Parser/builtin_classify_type.c | 2 +- clang/test/Parser/builtin_source_location.c | 2 +- clang/test/Parser/builtin_types_compatible.c | 4 +- clang/test/Parser/c-namespace.c | 2 +- clang/test/Parser/c11-noreturn.c | 8 ++-- clang/test/Parser/captured-statements.c | 4 +- clang/test/Parser/check_cast.c | 2 +- clang/test/Parser/compound_literal.c | 2 +- clang/test/Parser/debugger-import-module.m | 2 +- clang/test/Parser/expressions.c | 16 +++---- clang/test/Parser/expressions.m | 2 +- clang/test/Parser/extension.c | 2 +- .../test/Parser/gcc-for-loop-init-compatibility.c | 2 +- clang/test/Parser/goto.c | 4 +- clang/test/Parser/implicit-casts.c | 6 +-- clang/test/Parser/ms-if-exists.c | 8 ++-- clang/test/Parser/ms-inline-asm-nested-braces.c | 2 +- clang/test/Parser/ms-inline-asm.c | 22 ++++----- clang/test/Parser/ms-seh.c | 6 +-- clang/test/SemaObjC/catch-invalid.m | 2 +- clang/test/SemaObjC/catch-stmt.m | 2 +- clang/test/SemaObjC/category-method-lookup.m | 2 +- clang/test/SemaObjC/check-dup-objc-decls-1.m | 2 +- clang/test/SemaObjC/circular-container.m | 16 +++---- .../test/SemaObjC/class-message-protocol-lookup.m | 2 +- clang/test/SemaObjC/class-property-access.m | 4 +- clang/test/SemaObjC/class-stub-attr.m | 2 +- clang/test/SemaObjC/class-unavail-warning.m | 4 +- clang/test/SemaObjC/compare-qualified-class.m | 2 +- clang/test/SemaObjC/compound-init.m | 2 +- clang/test/SemaObjC/comptypes-1.m | 4 +- clang/test/SemaObjC/comptypes-2.m | 2 +- clang/test/SemaObjC/comptypes-3.m | 4 +- clang/test/SemaObjC/comptypes-4.m | 4 +- clang/test/SemaObjC/comptypes-5.m | 4 +- clang/test/SemaObjC/comptypes-7.m | 4 +- clang/test/SemaObjC/comptypes-8.m | 2 +- clang/test/SemaObjC/comptypes-legal.m | 2 +- clang/test/SemaObjC/debugger-cast-result-to-id.m | 6 +-- clang/test/SemaObjC/delay-parsing-cfunctions.m | 2 +- .../test/SemaObjC/deprecate_function_containers.m | 16 +++---- .../test/SemaObjC/deprecated-objc-introspection.m | 2 +- .../test/SemaObjC/dictionary-literal-duplicates.m | 2 +- clang/test/SemaObjC/dllexport.m | 2 +- clang/test/SemaObjC/dllimport.m | 2 +- clang/test/SemaObjC/encode-typeof-test.m | 4 +- clang/test/SemaObjC/enum-fixed-type.m | 2 +- .../test/SemaObjC/error-outof-scope-property-use.m | 2 +- clang/test/SemaObjC/exprs.m | 4 +- clang/test/SemaObjC/externally-retained.m | 8 ++-- clang/test/SemaObjC/foreach.m | 4 +- clang/test/SemaObjC/format-cstrings-warning.m | 2 +- clang/test/SemaObjC/format-ostrace-warning.m | 2 +- clang/test/SemaObjC/format-size-spec-nsinteger.m | 2 +- clang/test/SemaObjC/format-strings-objc.m | 30 ++++++------- clang/test/SemaObjC/gc-attributes.m | 4 +- clang/test/SemaObjC/iboutlet.m | 2 +- clang/test/SemaObjC/id.m | 2 +- .../SemaObjC/ignore-qualifier-on-qualified-id.m | 2 +- clang/test/SemaObjC/illegal-nonarc-bridged-cast.m | 18 ++++---- clang/test/SemaObjC/infer-availability-from-init.m | 8 ++-- clang/test/SemaObjC/instancetype.m | 6 +-- clang/test/SemaObjC/interface-1.m | 2 +- clang/test/SemaObjC/invalid-code.m | 4 +- clang/test/SemaObjC/invalid-receiver.m | 2 +- clang/test/SemaObjC/ivar-sem-check-1.m | 2 +- clang/test/SemaObjC/kindof.m | 10 ++--- clang/test/SemaObjC/legacy-implementation-1.m | 2 +- clang/test/SemaObjC/message.m | 4 +- clang/test/SemaObjC/method-arg-qualifier-warning.m | 2 +- clang/test/SemaObjC/method-bad-param.m | 4 +- clang/test/SemaObjC/method-not-defined.m | 2 +- clang/test/SemaObjC/method-sentinel-attr.m | 2 +- clang/test/SemaObjC/mrc-weak.m | 2 +- clang/test/SemaObjC/no-objc-exceptions.m | 4 +- .../SemaObjC/ns_returns_retained_block_return.m | 8 ++-- clang/test/SemaObjC/nsobject-attribute.m | 2 +- clang/test/SemaObjC/nullability.m | 2 +- clang/test/SemaObjC/nullable-result.m | 4 +- clang/test/SemaObjC/objc-array-literal.m | 12 ++--- .../test/SemaObjC/objc-boxed-expressions-nsvalue.m | 10 ++--- clang/test/SemaObjC/objc-buffered-methods.m | 2 +- clang/test/SemaObjC/objc-class-property.m | 4 +- .../test/SemaObjC/objc-container-subscripting-1.m | 2 +- .../test/SemaObjC/objc-container-subscripting-2.m | 4 +- .../test/SemaObjC/objc-container-subscripting-3.m | 2 +- clang/test/SemaObjC/objc-container-subscripting.m | 4 +- clang/test/SemaObjC/objc-cstyle-args-in-methods.m | 2 +- clang/test/SemaObjC/objc-dictionary-literal.m | 8 ++-- .../SemaObjC/objc-independent-class-attribute.m | 4 +- clang/test/SemaObjC/objc-literal-fixit.m | 2 +- clang/test/SemaObjC/objc-literal-nsnumber.m | 18 ++++---- clang/test/SemaObjC/objc-literal-sig.m | 2 +- clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m | 8 ++-- clang/test/SemaObjC/objc2-warn-weak-decl.m | 2 +- clang/test/SemaObjC/objcbridge-attribute.m | 4 +- clang/test/SemaObjC/opaque-is-access-warn.m | 2 +- clang/test/SemaObjC/opaque-is-access.m | 2 +- clang/test/SemaObjC/ovl-check.m | 2 +- clang/test/SemaObjC/parameterized_classes.m | 2 +- clang/test/SemaObjC/potentially-direct-selector.m | 2 +- clang/test/SemaObjC/property-10.m | 8 ++-- clang/test/SemaObjC/property-13.m | 2 +- .../test/SemaObjC/property-error-readonly-assign.m | 2 +- clang/test/SemaObjC/property-expression-error.m | 4 +- clang/test/SemaObjC/property-in-class-extension.m | 2 +- clang/test/SemaObjC/property-not-lvalue.m | 2 +- clang/test/SemaObjC/property.m | 4 +- clang/test/SemaObjC/protocol-attribute.m | 2 +- clang/test/SemaObjC/protocol-expr-1.m | 2 +- clang/test/SemaObjC/protocol-expr-neg-1.m | 2 +- clang/test/SemaObjC/protocol-typecheck.m | 2 +- clang/test/SemaObjC/protocol-warn.m | 2 +- clang/test/SemaObjC/rdar6248119.m | 6 +-- .../test/SemaObjC/related-result-type-inference.m | 2 +- .../test/SemaObjC/resolve-method-in-global-pool.m | 2 +- clang/test/SemaObjC/return.m | 4 +- clang/test/SemaObjC/scope-check.m | 4 +- clang/test/SemaObjC/selector-1.m | 6 +-- clang/test/SemaObjC/selector-2.m | 2 +- clang/test/SemaObjC/selector-3.m | 4 +- clang/test/SemaObjC/selector-4.m | 2 +- clang/test/SemaObjC/selector-overload.m | 2 +- clang/test/SemaObjC/setter-dotsyntax.m | 2 +- clang/test/SemaObjC/sign-conversion.m | 4 +- clang/test/SemaObjC/signed-char-bool-conversion.m | 2 +- clang/test/SemaObjC/sizeof-interface.m | 2 +- clang/test/SemaObjC/special-dep-unavail-warning.m | 2 +- clang/test/SemaObjC/static-ivar-ref-1.m | 2 +- clang/test/SemaObjC/super-property-notation.m | 2 +- clang/test/SemaObjC/super.m | 6 +-- clang/test/SemaObjC/synchronized.m | 2 +- clang/test/SemaObjC/synth-provisional-ivars-1.m | 2 +- .../SemaObjC/transfer-boxed-string-nullability.m | 2 +- clang/test/SemaObjC/try-catch.m | 2 +- clang/test/SemaObjC/ucn-objc-string.m | 2 +- .../SemaObjC/unguarded-availability-maccatalyst.m | 16 +++---- clang/test/SemaObjC/unguarded-availability-new.m | 8 ++-- clang/test/SemaObjC/unguarded-availability.m | 38 ++++++++-------- clang/test/SemaObjC/uninit-variables.m | 6 +-- clang/test/SemaObjC/unknown-anytype.m | 4 +- .../SemaObjC/unqualified-to-qualified-class-warn.m | 2 +- clang/test/SemaObjC/unused.m | 2 +- clang/test/SemaObjC/warn-cast-of-sel-expr.m | 2 +- clang/test/SemaObjC/warn-direct-ivar-access.m | 2 +- .../SemaObjC/warn-incompatible-builtin-types.m | 2 +- clang/test/SemaObjC/warn-loop-analysis.m | 2 +- clang/test/SemaObjC/warn-retain-block-property.m | 4 +- clang/test/SemaObjC/warn-retain-cycle.m | 2 +- clang/test/SemaObjC/warn-strict-selector-match.m | 2 +- clang/test/SemaObjC/warn-unreachable.m | 12 ++--- clang/test/SemaObjC/warn-unused-exception-param.m | 2 +- clang/test/SemaObjC/warn-weak-field.m | 2 +- 166 files changed, 401 insertions(+), 401 deletions(-) diff --git a/clang/test/Parser/CompoundStmtScope.c b/clang/test/Parser/CompoundStmtScope.c index 4f99103..ab056f0 100644 --- a/clang/test/Parser/CompoundStmtScope.c +++ b/clang/test/Parser/CompoundStmtScope.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -void foo() { +void foo(void) { { typedef float X; } diff --git a/clang/test/Parser/MicrosoftExtensions.c b/clang/test/Parser/MicrosoftExtensions.c index 2af6c42..92cfb04 100644 --- a/clang/test/Parser/MicrosoftExtensions.c +++ b/clang/test/Parser/MicrosoftExtensions.c @@ -94,11 +94,11 @@ int * __sptr * __ptr32 ppsp32; // Ignored type qualifiers after comma in declarator lists typedef int ignored_quals_dummy1, const volatile __ptr32 __ptr64 __w64 __unaligned __sptr __uptr ignored_quals1; // expected-warning {{qualifiers after comma in declarator list are ignored}} -typedef void(*ignored_quals_dummy2)(), __fastcall ignored_quals2; // expected-warning {{qualifiers after comma in declarator list are ignored}} -typedef void(*ignored_quals_dummy3)(), __stdcall ignored_quals3; // expected-warning {{qualifiers after comma in declarator list are ignored}} -typedef void(*ignored_quals_dummy4)(), __thiscall ignored_quals4; // expected-warning {{qualifiers after comma in declarator list are ignored}} -typedef void(*ignored_quals_dummy5)(), __cdecl ignored_quals5; // expected-warning {{qualifiers after comma in declarator list are ignored}} -typedef void(*ignored_quals_dummy6)(), __vectorcall ignored_quals6; // expected-warning {{qualifiers after comma in declarator list are ignored}} +typedef void(*ignored_quals_dummy2)(void), __fastcall ignored_quals2; // expected-warning {{qualifiers after comma in declarator list are ignored}} +typedef void(*ignored_quals_dummy3)(void), __stdcall ignored_quals3; // expected-warning {{qualifiers after comma in declarator list are ignored}} +typedef void(*ignored_quals_dummy4)(void), __thiscall ignored_quals4; // expected-warning {{qualifiers after comma in declarator list are ignored}} +typedef void(*ignored_quals_dummy5)(void), __cdecl ignored_quals5; // expected-warning {{qualifiers after comma in declarator list are ignored}} +typedef void(*ignored_quals_dummy6)(void), __vectorcall ignored_quals6; // expected-warning {{qualifiers after comma in declarator list are ignored}} __declspec(align(16)) struct align_before_key1 {}; __declspec(align(16)) struct align_before_key2 {} align_before_key2_var; diff --git a/clang/test/Parser/altivec-non-type-vector.c b/clang/test/Parser/altivec-non-type-vector.c index d0868a6..373284a 100644 --- a/clang/test/Parser/altivec-non-type-vector.c +++ b/clang/test/Parser/altivec-non-type-vector.c @@ -4,8 +4,8 @@ // RUN: %clang_cc1 -target-feature +altivec -fsyntax-only %s -triple powerpc-ibm-aix-xcoff // RUN: %clang_cc1 -target-feature +altivec -fsyntax-only %s -triple powerpc-linux-gnu -int vector(); +int vector(void); -void test() { +void test(void) { vector unsigned int v = {0}; } diff --git a/clang/test/Parser/altivec-typedef-vector.c b/clang/test/Parser/altivec-typedef-vector.c index 5e00824..62c95f4 100644 --- a/clang/test/Parser/altivec-typedef-vector.c +++ b/clang/test/Parser/altivec-typedef-vector.c @@ -6,6 +6,6 @@ typedef int vector; -void test() { +void test(void) { vector unsigned int v = {0}; } diff --git a/clang/test/Parser/altivec.c b/clang/test/Parser/altivec.c index db2264e..3f344e9 100644 --- a/clang/test/Parser/altivec.c +++ b/clang/test/Parser/altivec.c @@ -25,7 +25,7 @@ __vector __bool short vv___bs; __vector __bool int vv___bi; __vector __pixel vv_p; __vector pixel vv__p; -__vector int vf__r(); +__vector int vf__r(void); void vf__a(__vector int a); void vf__a2(int b, __vector int a); @@ -50,7 +50,7 @@ vector __bool short v___bs; vector __bool int v___bi; vector __pixel v_p; vector pixel v__p; -vector int f__r(); +vector int f__r(void); void f_a(vector int a); void f_a2(int b, vector int a); @@ -146,7 +146,7 @@ struct S { vector short i32; }; -void f() { +void f(void) { __vector unsigned int v = {0,0,0,0}; __vector int v__cast = (__vector int)v; __vector int v_cast = (vector int)v; diff --git a/clang/test/Parser/asm.c b/clang/test/Parser/asm.c index b4cadee..37b3ba3 100644 --- a/clang/test/Parser/asm.c +++ b/clang/test/Parser/asm.c @@ -4,18 +4,18 @@ #error Extension 'gnu_asm' should be available by default #endif -void f1() { +void f1(void) { // PR7673: Some versions of GCC support an empty clobbers section. asm ("ret" : : :); } -void f2() { +void f2(void) { asm("foo" : "=r" (a)); // expected-error {{use of undeclared identifier 'a'}} asm("foo" : : "r" (b)); // expected-error {{use of undeclared identifier 'b'}} } -void a() __asm__(""); // expected-error {{cannot use an empty string literal in 'asm'}} -void a() { +void a(void) __asm__(""); // expected-error {{cannot use an empty string literal in 'asm'}} +void a(void) { __asm__(""); // ok } diff --git a/clang/test/Parser/atomic.c b/clang/test/Parser/atomic.c index e821496..58a33aa 100644 --- a/clang/test/Parser/atomic.c +++ b/clang/test/Parser/atomic.c @@ -25,8 +25,8 @@ typedef int (*_Atomic atomic_int_ptr); // ext-warning {{'_Atomic' is a C11 exten typedef int _Atomic *int_atomic_ptr; // ext-warning {{'_Atomic' is a C11 extension}} typedef _Atomic(int) *int_atomic_ptr; // ext-warning {{'_Atomic' is a C11 extension}} -typedef int int_fn(); -typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int ()')}} \ +typedef int int_fn(void); +typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int (void)')}} \ // ext-warning {{'_Atomic' is a C11 extension}} typedef _Atomic int atomic_int_array[3]; // ext-warning {{'_Atomic' is a C11 extension}} typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int)[3]')}} \ @@ -44,4 +44,4 @@ typedef _Atomic(int __attribute__((vector_size(16)))) atomic_vector_int; // ext- struct S _Atomic atomic_s_no_missing_semicolon; // ext-warning {{'_Atomic' is a C11 extension}} -int *const _Atomic atomic_return_type(); // ext-warning {{'_Atomic' is a C11 extension}} +int *const _Atomic atomic_return_type(void); // ext-warning {{'_Atomic' is a C11 extension}} diff --git a/clang/test/Parser/attr-availability.c b/clang/test/Parser/attr-availability.c index 6a5c659..eb934f3 100644 --- a/clang/test/Parser/attr-availability.c +++ b/clang/test/Parser/attr-availability.c @@ -4,31 +4,31 @@ # error 'availability' attribute is not available #endif -void f0() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); +void f0(void) __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); -void f1() __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6))); +void f1(void) __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6))); -void f2() __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6))); +void f2(void) __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6))); -void f3() __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6,introduced=10.2))); // expected-error{{redundant 'introduced' availability change; only the last specified change will be used}} +void f3(void) __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6,introduced=10.2))); // expected-error{{redundant 'introduced' availability change; only the last specified change will be used}} -void f4() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable))); +void f4(void) __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable))); -void f5() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}} +void f5(void) __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}} -void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}} +void f6(void) __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}} -void f7() __attribute__((availability(macosx,message=L"wide"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} +void f7(void) __attribute__((availability(macosx,message=L"wide"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} -void f8() __attribute__((availability(macosx,message="a" L"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} +void f8(void) __attribute__((availability(macosx,message="a" L"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} -void f9() __attribute__((availability(macosx,message=u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} +void f9(void) __attribute__((availability(macosx,message=u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} -void f10() __attribute__((availability(macosx,message="a" u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} +void f10(void) __attribute__((availability(macosx,message="a" u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} -void f11() __attribute__((availability(macosx,message=u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} +void f11(void) __attribute__((availability(macosx,message=u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} -void f12() __attribute__((availability(macosx,message="a" u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} +void f12(void) __attribute__((availability(macosx,message="a" u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}} // rdar://10095131 enum E{ diff --git a/clang/test/Parser/attr-external-source-symbol.m b/clang/test/Parser/attr-external-source-symbol.m index 772fde0..752c748 100644 --- a/clang/test/Parser/attr-external-source-symbol.m +++ b/clang/test/Parser/attr-external-source-symbol.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -void function() __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration))); +void function(void) __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration))); __attribute__((external_source_symbol(language="Swift", defined_in="module"))) @interface I @@ -14,71 +14,71 @@ enum E { CaseB __attribute__((external_source_symbol(generated_declaration, language="Swift"))) } __attribute__((external_source_symbol(language = "Swift"))); -void f2() +void f2(void) __attribute__((external_source_symbol())); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} -void f3() +void f3(void) __attribute__((external_source_symbol(invalid))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} -void f4() +void f4(void) __attribute__((external_source_symbol(language))); // expected-error {{expected '=' after language}} -void f5() +void f5(void) __attribute__((external_source_symbol(language=))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}} -void f6() +void f6(void) __attribute__((external_source_symbol(defined_in=20))); // expected-error {{expected string literal for source container name in 'external_source_symbol' attribute}} -void f7() +void f7(void) __attribute__((external_source_symbol(generated_declaration, generated_declaration))); // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}} -void f8() +void f8(void) __attribute__((external_source_symbol(language="Swift", language="Swift"))); // expected-error {{duplicate 'language' clause in an 'external_source_symbol' attribute}} -void f9() +void f9(void) __attribute__((external_source_symbol(defined_in="module", language="Swift", defined_in="foo"))); // expected-error {{duplicate 'defined_in' clause in an 'external_source_symbol' attribute}} -void f10() +void f10(void) __attribute__((external_source_symbol(generated_declaration, language="Swift", defined_in="foo", generated_declaration, generated_declaration, language="Swift"))); // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}} -void f11() +void f11(void) __attribute__((external_source_symbol(language="Objective-C++", defined_in="Some file with spaces"))); -void f12() +void f12(void) __attribute__((external_source_symbol(language="C Sharp", defined_in="file:////Hello world with spaces. cs"))); -void f13() +void f13(void) __attribute__((external_source_symbol(language=Swift))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}} -void f14() +void f14(void) __attribute__((external_source_symbol(=))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} -void f15() +void f15(void) __attribute__((external_source_symbol(="Swift"))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} -void f16() +void f16(void) __attribute__((external_source_symbol("Swift", "module", generated_declaration))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} -void f17() +void f17(void) __attribute__((external_source_symbol(language="Swift", "generated_declaration"))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} -void f18() +void f18(void) __attribute__((external_source_symbol(language= =))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}} -void f19() +void f19(void) __attribute__((external_source_symbol(defined_in="module" language="swift"))); // expected-error {{expected ')'}} expected-note {{to match this '('}} -void f20() +void f20(void) __attribute__((external_source_symbol(defined_in="module" language="swift" generated_declaration))); // expected-error {{expected ')'}} expected-note {{to match this '('}} -void f21() +void f21(void) __attribute__((external_source_symbol(defined_in= language="swift"))); // expected-error {{expected string literal for source container name in 'external_source_symbol' attribute}} -void f22() +void f22(void) __attribute__((external_source_symbol)); // expected-error {{'external_source_symbol' attribute takes at least 1 argument}} -void f23() +void f23(void) __attribute__((external_source_symbol(defined_in=, language="swift" generated_declaration))); // expected-error {{expected string literal for source container name in 'external_source_symbol' attribute}} expected-error{{expected ')'}} expected-note{{to match this '('}} -void f24() +void f24(void) __attribute__((external_source_symbol(language = generated_declaration))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}} -void f25() +void f25(void) __attribute__((external_source_symbol(defined_in=123, defined_in="module"))); // expected-error {{expected string literal for source container name in 'external_source_symbol'}} expected-error {{duplicate 'defined_in' clause in an 'external_source_symbol' attribute}} -void f26() +void f26(void) __attribute__((external_source_symbol(language=Swift, language="Swift", error))); // expected-error {{expected string literal for language name in 'external_source_symbol'}} expected-error {{duplicate 'language' clause in an 'external_source_symbol' attribute}} expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}} diff --git a/clang/test/Parser/attributes.c b/clang/test/Parser/attributes.c index 26ece79..60cd509 100644 --- a/clang/test/Parser/attributes.c +++ b/clang/test/Parser/attributes.c @@ -55,7 +55,7 @@ void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn)); // PR6287 -void __attribute__((returns_twice)) returns_twice_test(); +void __attribute__((returns_twice)) returns_twice_test(void); int aligned(int); int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error 2{{expected ')'}} expected-note {{to match}} expected-warning {{does not declare anything}} @@ -70,7 +70,7 @@ int testFundef1(int *a) __attribute__((nonnull(1))) { // \ } // noreturn is lifted to type qualifier -void testFundef2() __attribute__((noreturn)) { // \ +void testFundef2(void) __attribute__((noreturn)) { // \ // expected-warning {{GCC does not allow 'noreturn' attribute in this position on a function definition}} testFundef2(); } @@ -90,7 +90,7 @@ int testFundef4(int *a) __attribute__((nonnull(1))) // \ } // GCC allows these -void testFundef5() __attribute__(()) { } +void testFundef5(void) __attribute__(()) { } __attribute__((pure)) int testFundef6(int a) { return a; } diff --git a/clang/test/Parser/bad-control.c b/clang/test/Parser/bad-control.c index 72614eb..b76a395 100644 --- a/clang/test/Parser/bad-control.c +++ b/clang/test/Parser/bad-control.c @@ -1,10 +1,10 @@ /* RUN: %clang_cc1 -fsyntax-only -verify %s */ -void foo() { +void foo(void) { break; /* expected-error {{'break' statement not in loop or switch statement}} */ } -void foo2() { +void foo2(void) { continue; /* expected-error {{'continue' statement not in loop statement}} */ } @@ -15,10 +15,10 @@ int pr8880_9 (int first) { } } -void pr8880_24() { +void pr8880_24(void) { for (({break;});;); // expected-error {{'break' statement not in loop or switch statement}} } -void pr8880_25() { +void pr8880_25(void) { for (({continue;});;); // expected-error {{'continue' statement not in loop statement}} } diff --git a/clang/test/Parser/block-block-storageclass.c b/clang/test/Parser/block-block-storageclass.c index 53cd997..0045fcf 100644 --- a/clang/test/Parser/block-block-storageclass.c +++ b/clang/test/Parser/block-block-storageclass.c @@ -3,7 +3,7 @@ int printf(const char *, ...); void _Block_byref_release(void*src){} -int main() { +int main(void) { __block int X = 1234; __block const char * message = "HELLO"; diff --git a/clang/test/Parser/brackets.c b/clang/test/Parser/brackets.c index 4ce38bd..a651c35 100644 --- a/clang/test/Parser/brackets.c +++ b/clang/test/Parser/brackets.c @@ -4,7 +4,7 @@ // RUN: %clang_cc1 -fsyntax-only %t -x c -DFIXIT // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s -strict-whitespace -void test1() { +void test1(void) { int a[] = {0,1,1,2,3}; int []b = {0,1,4,9,16}; // expected-error@-1{{brackets are not allowed here; to declare an array, place the brackets after the identifier}} @@ -32,7 +32,7 @@ struct S { } s; #ifndef FIXIT -void test2() { +void test2(void) { int [][][]; // expected-error@-1{{expected identifier or '('}} // CHECK: {{^}} int [][][]; @@ -47,7 +47,7 @@ void test2() { }; } -void test3() { +void test3(void) { int [5] *; // expected-error@-1{{expected identifier or '('}} // CHECK: {{^}} int [5] *; diff --git a/clang/test/Parser/builtin_classify_type.c b/clang/test/Parser/builtin_classify_type.c index 94434e9..6765451 100644 --- a/clang/test/Parser/builtin_classify_type.c +++ b/clang/test/Parser/builtin_classify_type.c @@ -2,7 +2,7 @@ struct foo { int a; }; -int main() { +int main(void) { int a; float b; double d; diff --git a/clang/test/Parser/builtin_source_location.c b/clang/test/Parser/builtin_source_location.c index 441c87b..02778bd 100644 --- a/clang/test/Parser/builtin_source_location.c +++ b/clang/test/Parser/builtin_source_location.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -int main() { +int main(void) { int line = __builtin_LINE(); __builtin_LINE(42); // expected-error {{expected ')'}} __builtin_LINE(double); // expected-error {{expected ')'}} diff --git a/clang/test/Parser/builtin_types_compatible.c b/clang/test/Parser/builtin_types_compatible.c index d967a70..e74cf76 100644 --- a/clang/test/Parser/builtin_types_compatible.c +++ b/clang/test/Parser/builtin_types_compatible.c @@ -18,7 +18,7 @@ extern double funcDouble(double); __builtin_choose_expr(__builtin_types_compatible_p(typeof(expr), float), funcFloat(expr), \ __builtin_choose_expr(__builtin_types_compatible_p(typeof(expr), double), funcDouble(expr), (void)0))) -static void test() +static void test(void) { int a; float b; @@ -44,7 +44,7 @@ static void test() enum E1 { E1Foo }; enum E2 { E2Foo }; -static void testGccCompatibility() { +static void testGccCompatibility(void) { _Static_assert(__builtin_types_compatible_p(const volatile int, int), ""); _Static_assert(__builtin_types_compatible_p(int[5], int[]), ""); _Static_assert(!__builtin_types_compatible_p(int[5], int[4]), ""); diff --git a/clang/test/Parser/c-namespace.c b/clang/test/Parser/c-namespace.c index fbef09e..b0f35b1 100644 --- a/clang/test/Parser/c-namespace.c +++ b/clang/test/Parser/c-namespace.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only %s -void bla1() { +void bla1(void) { struct XXX; int XXX; } diff --git a/clang/test/Parser/c11-noreturn.c b/clang/test/Parser/c11-noreturn.c index 6666731..0ce883e 100644 --- a/clang/test/Parser/c11-noreturn.c +++ b/clang/test/Parser/c11-noreturn.c @@ -1,15 +1,15 @@ // RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s // RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s -_Noreturn int f(); -int _Noreturn f(); // expected-note {{previous}} +_Noreturn int f(void); +int _Noreturn f(void); // expected-note {{previous}} int f _Noreturn(); // expected-error {{expected ';'}} expected-error 2{{}} -int f() _Noreturn; // expected-error {{'_Noreturn' keyword must precede function declarator}} +int f(void) _Noreturn; // expected-error {{'_Noreturn' keyword must precede function declarator}} _Noreturn char c1; // expected-error {{'_Noreturn' can only appear on functions}} char _Noreturn c2; // expected-error {{'_Noreturn' can only appear on functions}} -typedef _Noreturn int g(); // expected-error {{'_Noreturn' can only appear on functions}} +typedef _Noreturn int g(void); // expected-error {{'_Noreturn' can only appear on functions}} _Noreturn int; // expected-error {{'_Noreturn' can only appear on functions}} expected-warning {{does not declare anything}} _Noreturn struct S; // expected-error {{'_Noreturn' can only appear on functions}} diff --git a/clang/test/Parser/captured-statements.c b/clang/test/Parser/captured-statements.c index 30dddb5..2993b35 100644 --- a/clang/test/Parser/captured-statements.c +++ b/clang/test/Parser/captured-statements.c @@ -1,13 +1,13 @@ // RUN: %clang_cc1 -verify %s -void test1() +void test1(void) { #pragma clang __debug captured x // expected-warning {{extra tokens at end of #pragma clang __debug captured directive}} { } } -void test2() +void test2(void) { #pragma clang __debug captured int x; // expected-error {{expected '{'}} diff --git a/clang/test/Parser/check_cast.c b/clang/test/Parser/check_cast.c index 790ee40..a2b6d86 100644 --- a/clang/test/Parser/check_cast.c +++ b/clang/test/Parser/check_cast.c @@ -3,7 +3,7 @@ struct foo { int a; }; -int main() { +int main(void) { struct foo xxx; int i; diff --git a/clang/test/Parser/compound_literal.c b/clang/test/Parser/compound_literal.c index 0054499..808ca63 100644 --- a/clang/test/Parser/compound_literal.c +++ b/clang/test/Parser/compound_literal.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s // expected-no-diagnostics -int main() { +int main(void) { char *s; s = (char []){"whatever"}; s = (char(*)){s}; diff --git a/clang/test/Parser/debugger-import-module.m b/clang/test/Parser/debugger-import-module.m index b6001ae..7f65583 100644 --- a/clang/test/Parser/debugger-import-module.m +++ b/clang/test/Parser/debugger-import-module.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -fdebugger-support -verify %s // expected-no-diagnostics -void importAModule() { +void importAModule(void) { @import AModuleThatDoesntExist } diff --git a/clang/test/Parser/expressions.c b/clang/test/Parser/expressions.c index 64b4447..82556c0 100644 --- a/clang/test/Parser/expressions.c +++ b/clang/test/Parser/expressions.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -void test1() { +void test1(void) { if (sizeof (int){ 1}) {} // sizeof compound literal if (sizeof (int)) {} // sizeof type @@ -18,19 +18,19 @@ int test3(int a, int b, int c) { return a = b = c; } -int test4() { +int test4(void) { test4(); return 0; } struct X0 { struct { struct { int c[10][9]; } b; } a; }; -int test_offsetof() { +int test_offsetof(void) { (void)__builtin_offsetof(struct X0, a.b.c[4][5]); return 0; } -void test_sizeof(){ +void test_sizeof(void){ int arr[10]; (void)sizeof arr[0]; (void)sizeof(arr[0]); @@ -38,7 +38,7 @@ void test_sizeof(){ } // PR3418 -int test_leading_extension() { +int test_leading_extension(void) { __extension__ (*(char*)0) = 1; // expected-warning {{indirection of non-volatile null pointer}} \ // expected-note {{consider using __builtin_trap}} return 0; @@ -53,7 +53,7 @@ int test6(void) { } // PR8394 -void test7() { +void test7(void) { ({} // expected-note {{to match}} ; // expected-error {{expected ')'}} } @@ -61,7 +61,7 @@ void test7() { // PR16992 struct pr16992 { int x; }; -void func_16992 () { +void func_16992 (void) { int x1 = sizeof int; // expected-error {{expected parentheses around type name in sizeof expression}} int x2 = sizeof struct pr16992; // expected-error {{expected parentheses around type name in sizeof expression}} int x3 = __alignof int; // expected-error {{expected parentheses around type name in __alignof expression}} @@ -69,7 +69,7 @@ void func_16992 () { } void callee(double, double); -void test8() { +void test8(void) { callee(foobar, // expected-error {{use of undeclared identifier 'foobar'}} fizbin); // expected-error {{use of undeclared identifier 'fizbin'}} } diff --git a/clang/test/Parser/expressions.m b/clang/test/Parser/expressions.m index 1f1005a..ab9aaf8 100644 --- a/clang/test/Parser/expressions.m +++ b/clang/test/Parser/expressions.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -void test1() { +void test1(void) { @"s"; // expected-warning {{expression result unused}} } diff --git a/clang/test/Parser/extension.c b/clang/test/Parser/extension.c index fd4cf80..b675f60 100644 --- a/clang/test/Parser/extension.c +++ b/clang/test/Parser/extension.c @@ -11,7 +11,7 @@ __extension__ typedef struct /* Decl/expr __extension__ marker. */ -void bar() { +void bar(void) { __extension__ int i; int j; __extension__ (j = 10LL); diff --git a/clang/test/Parser/gcc-for-loop-init-compatibility.c b/clang/test/Parser/gcc-for-loop-init-compatibility.c index dc88f08..8bf439d 100644 --- a/clang/test/Parser/gcc-for-loop-init-compatibility.c +++ b/clang/test/Parser/gcc-for-loop-init-compatibility.c @@ -6,7 +6,7 @@ // expected-no-diagnostics #endif -void foo() { +void foo(void) { #ifndef C99 // expected-warning@+2{{GCC does not allow variable declarations in for loop initializers before C99}} #endif diff --git a/clang/test/Parser/goto.c b/clang/test/Parser/goto.c index a3e0117..f34e7e2 100644 --- a/clang/test/Parser/goto.c +++ b/clang/test/Parser/goto.c @@ -1,12 +1,12 @@ /* RUN: %clang_cc1 -fsyntax-only -verify %s */ -void test1() { +void test1(void) { goto ; /* expected-error {{expected identifier}} */ } -void test2() { +void test2(void) { l: /* expected-note {{previous definition is here}} */ { diff --git a/clang/test/Parser/implicit-casts.c b/clang/test/Parser/implicit-casts.c index a2b31f9..65a1968 100644 --- a/clang/test/Parser/implicit-casts.c +++ b/clang/test/Parser/implicit-casts.c @@ -3,7 +3,7 @@ _Complex double X; void test1(int c) { X = 5; } -void test2() { +void test2(void) { int i; double d = i; double _Complex a = 5; @@ -12,9 +12,9 @@ void test2() { a = 5; d = i; } -int test3() { +int test3(void) { int a[2]; - a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning to 'int' from 'int ()'}} + a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning to 'int' from 'int (void)'}} return 0; } short x; void test4(char c) { x += c; } diff --git a/clang/test/Parser/ms-if-exists.c b/clang/test/Parser/ms-if-exists.c index 7dd2054..66b8542 100644 --- a/clang/test/Parser/ms-if-exists.c +++ b/clang/test/Parser/ms-if-exists.c @@ -4,7 +4,7 @@ struct Type { }; -void test_if_exists_stmts() { +void test_if_exists_stmts(void) { int b = 0; __if_exists(Type) { b++; @@ -22,7 +22,7 @@ void test_if_exists_stmts() { } } -int if_exists_creates_no_scope() { +int if_exists_creates_no_scope(void) { __if_exists(Type) { int x; // 'x' is declared in the parent scope. } @@ -48,7 +48,7 @@ __if_not_exists(Type_not) { int var244; } -void test_if_exists_init_list() { +void test_if_exists_init_list(void) { int array1[] = { 0, @@ -77,7 +77,7 @@ void test_if_exists_init_list() { } -void test_nested_if_exists() { +void test_nested_if_exists(void) { __if_exists(Type) { int x = 42; __if_not_exists(Type_not) { diff --git a/clang/test/Parser/ms-inline-asm-nested-braces.c b/clang/test/Parser/ms-inline-asm-nested-braces.c index 58b055b..90712ef 100644 --- a/clang/test/Parser/ms-inline-asm-nested-braces.c +++ b/clang/test/Parser/ms-inline-asm-nested-braces.c @@ -1,7 +1,7 @@ // REQUIRES: x86-registered-target // RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks -int t_fail() { // expected-note {{to match this}} +int t_fail(void) { // expected-note {{to match this}} __asm { // expected-note {{to match this}} { // expected-note {{to match this}} diff --git a/clang/test/Parser/ms-inline-asm.c b/clang/test/Parser/ms-inline-asm.c index c6af1ea..44f84a5 100644 --- a/clang/test/Parser/ms-inline-asm.c +++ b/clang/test/Parser/ms-inline-asm.c @@ -10,33 +10,33 @@ void t1(void) { M } void t2(void) { __asm int 2ch } void t3(void) { __asm M2 2ch } void t4(void) { __asm mov eax, fs:[10h] } -void t5() { +void t5(void) { __asm { int 0x2c ; } asm comments are fun! }{ } __asm {} } -int t6() { +int t6(void) { __asm int 3 ; } comments for single-line asm __asm {} __asm int 4 return 10; } -void t7() { +void t7(void) { __asm { push ebx mov ebx, 07h pop ebx } } -void t8() { +void t8(void) { __asm nop __asm nop __asm nop } -void t9() { +void t9(void) { __asm nop __asm nop ; __asm nop } -void t10() { +void t10(void) { __asm { mov eax, 0 __asm { @@ -47,21 +47,21 @@ void t10() { } } } -void t11() { +void t11(void) { do { __asm mov eax, 0 __asm { __asm mov edx, 1 } } while(0); } -void t12() { +void t12(void) { __asm jmp label // expected-error {{use of undeclared label 'label'}} } -void t13() { +void t13(void) { __asm m{o}v eax, ebx // expected-error {{unknown token in expression}} } -void t14() { +void t14(void) { enum { A = 1, B }; __asm mov eax, offset A // expected-error {{offset operator cannot yet handle constants}} } -int t_fail() { // expected-note {{to match this}} +int t_fail(void) { // expected-note {{to match this}} __asm __asm { // expected-error 3 {{expected}} expected-note {{to match this}} diff --git a/clang/test/Parser/ms-seh.c b/clang/test/Parser/ms-seh.c index 68c2e30..90a6c62 100644 --- a/clang/test/Parser/ms-seh.c +++ b/clang/test/Parser/ms-seh.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions -void f() { +void f(void) { int a; __try a; // expected-error {{expected '{'}} expected-warning {{expression result unused}} @@ -9,14 +9,14 @@ void f() { } } // expected-error {{expected '__except' or '__finally' block}} -void g() { +void g(void) { int a; __try { } __except(1) a; // expected-error {{expected '{'}} expected-warning {{expression result unused}} } -void h() { +void h(void) { int a; __try { diff --git a/clang/test/SemaObjC/catch-invalid.m b/clang/test/SemaObjC/catch-invalid.m index 352b2fb..9903d93 100644 --- a/clang/test/SemaObjC/catch-invalid.m +++ b/clang/test/SemaObjC/catch-invalid.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -fobjc-exceptions -fobjc-runtime=ios -verify %s extern void g(void); -void f() { +void f(void) { @try { g(); } @catch (Class c) { // expected-error{{@catch parameter is not a pointer to an interface type}} diff --git a/clang/test/SemaObjC/catch-stmt.m b/clang/test/SemaObjC/catch-stmt.m index dcb4764..c6fff9c 100644 --- a/clang/test/SemaObjC/catch-stmt.m +++ b/clang/test/SemaObjC/catch-stmt.m @@ -2,7 +2,7 @@ @interface A @end @protocol P; -void f() { +void f(void) { @try { } @catch (void a) { // expected-error{{@catch parameter is not a pointer to an interface type}} } @catch (int) { // expected-error{{@catch parameter is not a pointer to an interface type}} diff --git a/clang/test/SemaObjC/category-method-lookup.m b/clang/test/SemaObjC/category-method-lookup.m index 6239e94..3435ed5 100644 --- a/clang/test/SemaObjC/category-method-lookup.m +++ b/clang/test/SemaObjC/category-method-lookup.m @@ -28,5 +28,5 @@ } @end -int main() {return 0;} +int main(void) {return 0;} diff --git a/clang/test/SemaObjC/check-dup-objc-decls-1.m b/clang/test/SemaObjC/check-dup-objc-decls-1.m index 7a2cd40..8867afe 100644 --- a/clang/test/SemaObjC/check-dup-objc-decls-1.m +++ b/clang/test/SemaObjC/check-dup-objc-decls-1.m @@ -22,7 +22,7 @@ typedef int Gorf; // expected-note {{previous definition is here}} @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}} -void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}} +void Gorf(void) // expected-error {{redefinition of 'Gorf' as different kind of symbol}} { int Bar, Foo, FooBar; } diff --git a/clang/test/SemaObjC/circular-container.m b/clang/test/SemaObjC/circular-container.m index 1f06595..a0e6bf5 100644 --- a/clang/test/SemaObjC/circular-container.m +++ b/clang/test/SemaObjC/circular-container.m @@ -103,7 +103,7 @@ void checkNSMutableOrderedSetParam(NSMutableOrderedSet *s) { // expected-note {{ [s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}} } -void checkNSMutableArray() { +void checkNSMutableArray(void) { NSMutableArray *a = nil; // expected-note 5 {{'a' declared here}} 5 [a addObject:a]; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}} @@ -113,7 +113,7 @@ void checkNSMutableArray() { a[0] = a; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}} } -void checkNSMutableDictionary() { +void checkNSMutableDictionary(void) { NSMutableDictionary *d = nil; // expected-note 4 {{'d' declared here}} [d setObject:d forKey:@"key"]; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}} @@ -122,19 +122,19 @@ void checkNSMutableDictionary() { d[@"key"] = d; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}} } -void checkNSMutableSet() { +void checkNSMutableSet(void) { NSMutableSet *s = nil; // expected-note {{'s' declared here}} [s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}} } -void checkNSCountedSet() { +void checkNSCountedSet(void) { NSCountedSet *s = nil; // expected-note {{'s' declared here}} [s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}} } -void checkNSMutableOrderedSet() { +void checkNSMutableOrderedSet(void) { NSMutableOrderedSet *s = nil; // expected-note 5 {{'s' declared here}} [s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}} @@ -180,7 +180,7 @@ void checkNSMutableOrderedSet() { @end -void subclassingNSMutableArray() { +void subclassingNSMutableArray(void) { FootableArray *a = nil; // expected-note 5 {{'a' declared here}} 5 [a addObject:a]; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}} @@ -190,7 +190,7 @@ void subclassingNSMutableArray() { a[0] = a; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}} } -void subclassingNSMutableDictionary() { +void subclassingNSMutableDictionary(void) { FootableDictionary *d = nil; // expected-note 4 {{'d' declared here}} [d setObject:d forKey:@"key"]; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}} @@ -199,7 +199,7 @@ void subclassingNSMutableDictionary() { d[@"key"] = d; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}} } -void subclassingNSMutableSet() { +void subclassingNSMutableSet(void) { FootableSet *s = nil; // expected-note {{'s' declared here}} [s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}} diff --git a/clang/test/SemaObjC/class-message-protocol-lookup.m b/clang/test/SemaObjC/class-message-protocol-lookup.m index d9f954d..a939707 100644 --- a/clang/test/SemaObjC/class-message-protocol-lookup.m +++ b/clang/test/SemaObjC/class-message-protocol-lookup.m @@ -25,7 +25,7 @@ + (id)alloc { return 0; } @end -int main () +int main (void) { Class c = [c alloc]; // expected-warning {{class method '+alloc' not found (return type defaults to 'id')}} Class c1 = [c1 alloc2]; // expected-warning {{instance method 'alloc2' found instead of class method 'alloc2'}} diff --git a/clang/test/SemaObjC/class-property-access.m b/clang/test/SemaObjC/class-property-access.m index d57b986..73f9d30 100644 --- a/clang/test/SemaObjC/class-property-access.m +++ b/clang/test/SemaObjC/class-property-access.m @@ -6,7 +6,7 @@ - (int)two; @end -int main () +int main (void) { return Test.one.two; } @@ -24,7 +24,7 @@ __attribute__((objc_root_class)) @end @interface Subclass : RootClass @end -void Test1() { +void Test1(void) { // now okay (void)RootClass.property; (void)Subclass.property; diff --git a/clang/test/SemaObjC/class-stub-attr.m b/clang/test/SemaObjC/class-stub-attr.m index 46c07d8..97a8103 100644 --- a/clang/test/SemaObjC/class-stub-attr.m +++ b/clang/test/SemaObjC/class-stub-attr.m @@ -24,4 +24,4 @@ __attribute__((objc_class_stub(123))) // expected-error {{'objc_class_stub' attr @end __attribute__((objc_class_stub)) // expected-error {{'objc_class_stub' attribute only applies to Objective-C interfaces}} -int cannotHaveObjCClassStubAttribute() {} +int cannotHaveObjCClassStubAttribute(void) {} diff --git a/clang/test/SemaObjC/class-unavail-warning.m b/clang/test/SemaObjC/class-unavail-warning.m index 30ebf79..fa99269 100644 --- a/clang/test/SemaObjC/class-unavail-warning.m +++ b/clang/test/SemaObjC/class-unavail-warning.m @@ -31,7 +31,7 @@ __attribute__((unavailable("not available"))) @implementation MyClass (Cat2) // no error. @end -int main() { +int main(void) { [MyClass new]; // expected-error {{'MyClass' is unavailable: not available}} [MyClass self]; // expected-error {{'MyClass' is unavailable: not available}} [MyClass addObject:((void *)0)]; // expected-error {{'MyClass' is unavailable: not available}} @@ -64,7 +64,7 @@ Foo *g_foo = 0; // expected-error {{'Foo' is unavailable}} @class Foo; @class Foo; @class Foo; -Foo * f_func() { // expected-error {{'Foo' is unavailable}} +Foo * f_func(void) { // expected-error {{'Foo' is unavailable}} return 0; } diff --git a/clang/test/SemaObjC/compare-qualified-class.m b/clang/test/SemaObjC/compare-qualified-class.m index c7d4a2e..e9df282 100644 --- a/clang/test/SemaObjC/compare-qualified-class.m +++ b/clang/test/SemaObjC/compare-qualified-class.m @@ -10,7 +10,7 @@ @interface SomeObject @end -int main () { +int main (void) { Class classA; Class classB; Class classC; diff --git a/clang/test/SemaObjC/compound-init.m b/clang/test/SemaObjC/compound-init.m index 7b288bb..ebd0617 100644 --- a/clang/test/SemaObjC/compound-init.m +++ b/clang/test/SemaObjC/compound-init.m @@ -2,6 +2,6 @@ @interface A @end -void f() { +void f(void) { (A){ 0 }; // expected-error{{cannot initialize Objective-C class type 'A'}} } diff --git a/clang/test/SemaObjC/comptypes-1.m b/clang/test/SemaObjC/comptypes-1.m index 67b73ce..a18ebd1 100644 --- a/clang/test/SemaObjC/comptypes-1.m +++ b/clang/test/SemaObjC/comptypes-1.m @@ -2,7 +2,7 @@ #define nil (void *)0; -extern void foo(); +extern void foo(void); @protocol MyProtocol - (void) foo; @@ -16,7 +16,7 @@ extern void foo(); - (void) foo; @end -int main() +int main(void) { id obj = nil; id obj_p = nil; diff --git a/clang/test/SemaObjC/comptypes-2.m b/clang/test/SemaObjC/comptypes-2.m index 8e90455..3589eba 100644 --- a/clang/test/SemaObjC/comptypes-2.m +++ b/clang/test/SemaObjC/comptypes-2.m @@ -11,7 +11,7 @@ @interface MyClass @end -int main() +int main(void) { id obj = nil; id obj_p = nil; diff --git a/clang/test/SemaObjC/comptypes-3.m b/clang/test/SemaObjC/comptypes-3.m index 6c1ce41..bb24328 100644 --- a/clang/test/SemaObjC/comptypes-3.m +++ b/clang/test/SemaObjC/comptypes-3.m @@ -2,7 +2,7 @@ #define nil (void *)0; -extern void foo(); +extern void foo(void); @protocol MyProtocolA - (void) methodA; @@ -19,7 +19,7 @@ extern void foo(); - (void) methodC; @end -int main() +int main(void) { id obj_a = nil; id obj_b = nil; diff --git a/clang/test/SemaObjC/comptypes-4.m b/clang/test/SemaObjC/comptypes-4.m index adc324c..f1c2e54 100644 --- a/clang/test/SemaObjC/comptypes-4.m +++ b/clang/test/SemaObjC/comptypes-4.m @@ -1,12 +1,12 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -extern void foo(); +extern void foo(void); @protocol MyProtocol @end @interface MyClass @end -int main() +int main(void) { MyClass *obj_p; MyClass *obj_cp; diff --git a/clang/test/SemaObjC/comptypes-5.m b/clang/test/SemaObjC/comptypes-5.m index 46300e3..4b50684 100644 --- a/clang/test/SemaObjC/comptypes-5.m +++ b/clang/test/SemaObjC/comptypes-5.m @@ -2,7 +2,7 @@ #define nil (void *)0; -extern void foo(); +extern void foo(void); @protocol MyProtocol - (void) method; @@ -18,7 +18,7 @@ extern void foo(); @interface MyOtherClass : MyClass @end -int main() +int main(void) { id obj_id_p = nil; MyClass *obj_c_cat_p = nil; diff --git a/clang/test/SemaObjC/comptypes-7.m b/clang/test/SemaObjC/comptypes-7.m index 4623cfd..fa836ce 100644 --- a/clang/test/SemaObjC/comptypes-7.m +++ b/clang/test/SemaObjC/comptypes-7.m @@ -2,7 +2,7 @@ #define nil (void *)0; -extern void foo(); +extern void foo(void); @protocol MyProtocol - (void) method; @@ -11,7 +11,7 @@ extern void foo(); @interface MyClass @end -int main() +int main(void) { id obj = nil; id obj_p = nil; diff --git a/clang/test/SemaObjC/comptypes-8.m b/clang/test/SemaObjC/comptypes-8.m index e651030..8bb99a1 100644 --- a/clang/test/SemaObjC/comptypes-8.m +++ b/clang/test/SemaObjC/comptypes-8.m @@ -6,7 +6,7 @@ id obj_p = 0; -int main() +int main(void) { obj_p = 0; } diff --git a/clang/test/SemaObjC/comptypes-legal.m b/clang/test/SemaObjC/comptypes-legal.m index 57b040c..58641b1 100644 --- a/clang/test/SemaObjC/comptypes-legal.m +++ b/clang/test/SemaObjC/comptypes-legal.m @@ -11,7 +11,7 @@ void __setRetained(id *ivar, id value, NSObject **o) { *ivar = value; } static NSString *_logProcessPrefix = 0; -void func() { +void func(void) { __setRetained(&_logProcessPrefix, _logProcessPrefix, &_logProcessPrefix); } @implementation NSObject (ScopeAdditions) diff --git a/clang/test/SemaObjC/debugger-cast-result-to-id.m b/clang/test/SemaObjC/debugger-cast-result-to-id.m index ecf3e74..c3c072a 100644 --- a/clang/test/SemaObjC/debugger-cast-result-to-id.m +++ b/clang/test/SemaObjC/debugger-cast-result-to-id.m @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s extern __unknown_anytype test0; -extern __unknown_anytype test1(); +extern __unknown_anytype test1(void); -void test_unknown_anytype_receiver() { +void test_unknown_anytype_receiver(void) { (void)(int)[[test0 unknownMethod] otherUnknownMethod];; (void)(id)[[test1() unknownMethod] otherUnknownMethod]; id x = test0; @@ -13,6 +13,6 @@ void test_unknown_anytype_receiver() { // rdar://10988847 @class NSString; // expected-note {{forward declaration of class here}} -void rdar10988847() { +void rdar10988847(void) { id s = [NSString stringWithUTF8String:"foo"]; // expected-warning {{receiver 'NSString' is a forward class and corresponding @interface may not exist}} } diff --git a/clang/test/SemaObjC/delay-parsing-cfunctions.m b/clang/test/SemaObjC/delay-parsing-cfunctions.m index c74b054..bd578bf 100644 --- a/clang/test/SemaObjC/delay-parsing-cfunctions.m +++ b/clang/test/SemaObjC/delay-parsing-cfunctions.m @@ -37,7 +37,7 @@ MyClass * myObject; static int getMe; -static int test() { +static int test(void) { return 0; } diff --git a/clang/test/SemaObjC/deprecate_function_containers.m b/clang/test/SemaObjC/deprecate_function_containers.m index 531cf11..f8aa10b 100644 --- a/clang/test/SemaObjC/deprecate_function_containers.m +++ b/clang/test/SemaObjC/deprecate_function_containers.m @@ -2,26 +2,26 @@ // rdar://10414277 @protocol P -void p_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} +void p_foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}} @end @interface I -void foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} -inline void v_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} -static int s_foo() {return 0; } // expected-warning {{function definition inside an Objective-C container is deprecated}} -static inline int si_val() { return 1; } // expected-warning {{function definition inside an Objective-C container is deprecated}} +void foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}} +inline void v_foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}} +static int s_foo(void) {return 0; } // expected-warning {{function definition inside an Objective-C container is deprecated}} +static inline int si_val(void) { return 1; } // expected-warning {{function definition inside an Objective-C container is deprecated}} @end @interface I(CAT) -void cat_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} +void cat_foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}} @end @implementation I -inline void v_imp_foo() {} +inline void v_imp_foo(void) {} @end @implementation I(CAT) -void cat_imp_foo() {} +void cat_imp_foo(void) {} @end // rdar://16859666 diff --git a/clang/test/SemaObjC/deprecated-objc-introspection.m b/clang/test/SemaObjC/deprecated-objc-introspection.m index 4f74841..e80a330 100644 --- a/clang/test/SemaObjC/deprecated-objc-introspection.m +++ b/clang/test/SemaObjC/deprecated-objc-introspection.m @@ -21,7 +21,7 @@ typedef struct objc_object { -(id)foo; @end -static void func() { +static void func(void) { id x; diff --git a/clang/test/SemaObjC/dictionary-literal-duplicates.m b/clang/test/SemaObjC/dictionary-literal-duplicates.m index 5bfe66d..2b31c0c8 100644 --- a/clang/test/SemaObjC/dictionary-literal-duplicates.m +++ b/clang/test/SemaObjC/dictionary-literal-duplicates.m @@ -23,7 +23,7 @@ count:(unsigned long)cnt; @end -void test() { +void test(void) { NSDictionary *t1 = @{ @"foo" : @0, // expected-note 2 {{previous equal key is here}} @"foo" : @0, // expected-warning{{duplicate key in dictionary literal}} diff --git a/clang/test/SemaObjC/dllexport.m b/clang/test/SemaObjC/dllexport.m index 11cd1fb..b306fae 100644 --- a/clang/test/SemaObjC/dllexport.m +++ b/clang/test/SemaObjC/dllexport.m @@ -6,7 +6,7 @@ typedef __declspec(dllexport) int typedef2; // expected-warning@-1{{'dllexport' attribute only applies to}} typedef int __declspec(dllexport) typedef3; // expected-warning@-1{{'dllexport' attribute only applies to}} -typedef __declspec(dllexport) void (*FunTy)(); +typedef __declspec(dllexport) void (*FunTy)(void); // expected-warning@-1{{'dllexport' attribute only applies to}} enum __declspec(dllexport) E { Val }; // expected-warning@-1{{'dllexport' attribute only applies to}} diff --git a/clang/test/SemaObjC/dllimport.m b/clang/test/SemaObjC/dllimport.m index ea87aea..ddc04d3 100644 --- a/clang/test/SemaObjC/dllimport.m +++ b/clang/test/SemaObjC/dllimport.m @@ -6,7 +6,7 @@ typedef __declspec(dllimport) int typedef2; // expected-warning@-1{{'dllimport' attribute only applies to}} typedef int __declspec(dllimport) typedef3; // expected-warning@-1{{'dllimport' attribute only applies to}} -typedef __declspec(dllimport) void (*FunTy)(); +typedef __declspec(dllimport) void (*FunTy)(void); // expected-warning@-1{{'dllimport' attribute only applies to}} enum __declspec(dllimport) E { Val }; // expected-warning@-1{{'dllimport' attribute only applies to}} diff --git a/clang/test/SemaObjC/encode-typeof-test.m b/clang/test/SemaObjC/encode-typeof-test.m index fe8f29c..d63164d 100644 --- a/clang/test/SemaObjC/encode-typeof-test.m +++ b/clang/test/SemaObjC/encode-typeof-test.m @@ -19,7 +19,7 @@ Class IVAR_Classx; @implementation Intf @end -int main() +int main(void) { int i; typeof(@encode(typeof(i))) e = @encode(typeof(Intf)); // expected-warning {{initializer-string for char array is too long}} @@ -39,7 +39,7 @@ struct foo { char *string; }; -const char *RetEncode () { +const char *RetEncode (void) { return @encode(struct foo); // expected-warning {{encoding of 'struct foo' type is incomplete because 'short8' (vector of 8 'short' values) component has unknown encoding}} } diff --git a/clang/test/SemaObjC/enum-fixed-type.m b/clang/test/SemaObjC/enum-fixed-type.m index 42308b7..987eb85 100644 --- a/clang/test/SemaObjC/enum-fixed-type.m +++ b/clang/test/SemaObjC/enum-fixed-type.m @@ -28,7 +28,7 @@ struct X { enum : Integer { Blah, Blarg } field4 : 4; }; -void test() { +void test(void) { long value = 2; Enumeration e = value; } diff --git a/clang/test/SemaObjC/error-outof-scope-property-use.m b/clang/test/SemaObjC/error-outof-scope-property-use.m index c480e2d..3072347 100644 --- a/clang/test/SemaObjC/error-outof-scope-property-use.m +++ b/clang/test/SemaObjC/error-outof-scope-property-use.m @@ -23,7 +23,7 @@ @end void -doLaunchdJobCPU() +doLaunchdJobCPU(void) { [uuids_jobs enumerateKeysAndObjectsUsingBlock]; // expected-error {{use of undeclared identifier 'uuids_jobs'}} } diff --git a/clang/test/SemaObjC/exprs.m b/clang/test/SemaObjC/exprs.m index b198cba..10ae20d6 100644 --- a/clang/test/SemaObjC/exprs.m +++ b/clang/test/SemaObjC/exprs.m @@ -7,7 +7,7 @@ Class test1(Class X) { // rdar://6079877 -void test2() { +void test2(void) { id str = @"foo" "bar\0" // no-warning @"baz" " blarg"; @@ -36,7 +36,7 @@ void test3(Object *o) { @class Incomplete_ObjC_class; // expected-note{{forward declaration of class here}} struct Incomplete_struct; // expected-note {{forward declaration}} -void test_encode() { +void test_encode(void) { (void)@encode(Incomplete_ObjC_class); // expected-error {{incomplete type}} (void)@encode(struct Incomplete_struct); // expected-error {{incomplete type}} (void)@encode(Incomplete_ObjC_class*); diff --git a/clang/test/SemaObjC/externally-retained.m b/clang/test/SemaObjC/externally-retained.m index f9fbdb0..6d983f4 100644 --- a/clang/test/SemaObjC/externally-retained.m +++ b/clang/test/SemaObjC/externally-retained.m @@ -6,12 +6,12 @@ @interface ObjCTy @end -void test1() { +void test1(void) { EXT_RET int a; // expected-warning{{'objc_externally_retained' can only be applied to}} EXT_RET __weak ObjCTy *b; // expected-warning{{'objc_externally_retained' can only be applied to}} - EXT_RET __weak int (^c)(); // expected-warning{{'objc_externally_retained' can only be applied to}} + EXT_RET __weak int (^c)(void); // expected-warning{{'objc_externally_retained' can only be applied to}} - EXT_RET int (^d)() = ^{return 0;}; + EXT_RET int (^d)(void) = ^{return 0;}; EXT_RET ObjCTy *e = 0; EXT_RET __strong ObjCTy *f = 0; @@ -37,7 +37,7 @@ EXT_RET ObjCTy *test3; // expected-warning{{'objc_externally_retained' can only } @end -void test4() { +void test4(void) { __attribute__((objc_externally_retained(0))) ObjCTy *a; // expected-error{{'objc_externally_retained' attribute takes no arguments}} } diff --git a/clang/test/SemaObjC/foreach.m b/clang/test/SemaObjC/foreach.m index 06800dd..e90f28a 100644 --- a/clang/test/SemaObjC/foreach.m +++ b/clang/test/SemaObjC/foreach.m @@ -38,7 +38,7 @@ typedef struct { @end -int main () +int main (void) { NSObject* collection = ((void*)0); for (id thing in collection) { } /* expected-warning {{unused variable 'thing'}} */ @@ -56,7 +56,7 @@ void test2(NSObject *collection) { } } -int cond(); +int cond(void); void test3(NSObject *a0, NSObject *a1) { for (id i in a0) { /* expected-note 2 {{jump enters Objective-C fast enumeration loop}} */ diff --git a/clang/test/SemaObjC/format-cstrings-warning.m b/clang/test/SemaObjC/format-cstrings-warning.m index 28fa7ce..421c23b 100644 --- a/clang/test/SemaObjC/format-cstrings-warning.m +++ b/clang/test/SemaObjC/format-cstrings-warning.m @@ -70,7 +70,7 @@ extern void MyNSLog(NSString *format, ...) __attribute__((format(__NSString__, 1 extern void MyCFStringCreateWithFormat(CFStringRef format, ...) __attribute__((format(__CFString__, 1, 2))); // expected-note {{'MyCFStringCreateWithFormat' declared here}} extern void XMyNSLog(int, NSString *format, ...) __attribute__((format(__NSString__, 2, 3))); // expected-note {{'XMyNSLog' declared here}} -void Test2() { +void Test2(void) { MyNSLog(@"%s\n", "Hello"); // expected-warning {{using %s directive in CFString which is being passed as a formatting argument to the formatting CFfunction}} MyCFStringCreateWithFormat((CFStringRef)@"%s", "Hello"); // expected-warning {{using %s directive in CFString which is being passed as a formatting argument to the formatting CFfunction}} diff --git a/clang/test/SemaObjC/format-ostrace-warning.m b/clang/test/SemaObjC/format-ostrace-warning.m index c749881..0177c85 100644 --- a/clang/test/SemaObjC/format-ostrace-warning.m +++ b/clang/test/SemaObjC/format-ostrace-warning.m @@ -41,7 +41,7 @@ extern void MyFStringCreateWithFormat(const char *format, ...) __attribute__((fo extern void XMyOSLog(int, const char* format, ...) __attribute__((format(os_trace, 2, 3))); extern void os_trace(const char *format, ...) __attribute__((format(os_trace, 1, 2))); -void Test2() { +void Test2(void) { MyOSLog("%s\n", "Hello"); MyFStringCreateWithFormat("%s", "Hello"); diff --git a/clang/test/SemaObjC/format-size-spec-nsinteger.m b/clang/test/SemaObjC/format-size-spec-nsinteger.m index e7c0a0d..8ecca6e 100644 --- a/clang/test/SemaObjC/format-size-spec-nsinteger.m +++ b/clang/test/SemaObjC/format-size-spec-nsinteger.m @@ -26,7 +26,7 @@ typedef int NSInteger; extern void NSLog(NSString *format, ...); -void testSizeSpecifier() { +void testSizeSpecifier(void) { NSInteger i = 0; NSUInteger j = 0; NSLog(@"max NSInteger = %zi", i); diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m index d804244..6850ebf 100644 --- a/clang/test/SemaObjC/format-strings-objc.m +++ b/clang/test/SemaObjC/format-strings-objc.m @@ -64,7 +64,7 @@ extern void NSLog2(int format, ...) __attribute__((format(__NSString__, 1, 2))); extern void CFStringCreateWithFormat2(int *format, ...) __attribute__((format(CFString, 1, 2))); // expected-error {{format argument not a CFString}} // - Catch use of long long with int arguments. -void rdar_7068334() { +void rdar_7068334(void) { long long test = 500; printf("%i ",test); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}} NSLog(@"%i ",test); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}} @@ -72,7 +72,7 @@ void rdar_7068334() { } // -void rdar_7697748() { +void rdar_7697748(void) { NSLog(@"%@!"); // expected-warning{{more '%' conversions than data arguments}} } @@ -87,7 +87,7 @@ void test_p_conversion_with_objc_pointer(id x, id y) { extern void MyNSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); extern void MyCFStringCreateWithFormat(CFStringRef format, ...) __attribute__((format(__CFString__, 1, 2))); -void check_mylog() { +void check_mylog(void) { MyNSLog(@"%@"); // expected-warning {{more '%' conversions than data arguments}} MyCFStringCreateWithFormat(CFSTR("%@")); // expected-warning {{more '%' conversions than data arguments}} } @@ -98,7 +98,7 @@ void check_mylog() { + (id)fooWithCStringFormat:(const char *)format, ... __attribute__((format(__printf__, 1, 2))); @end -void check_method() { +void check_method(void) { [Foo fooWithFormat:@"%@"]; // expected-warning {{more '%' conversions than data arguments}} [Foo fooWithCStringFormat:"%@"]; // expected-warning {{invalid conversion specifier '@'}} } @@ -138,12 +138,12 @@ NSString *test_literal_propagation(void) { #define MyNSLocalizedString(key) GetLocalizedString(key) #define MyNSAssert(fmt, arg) NSLog(fmt, arg, 0, 0) -void check_NSLocalizedString() { +void check_NSLocalizedString(void) { [Foo fooWithFormat:NSLocalizedString(@"format"), @"arg"]; // no-warning [Foo fooWithFormat:MyNSLocalizedString(@"format"), @"arg"]; // expected-warning {{format string is not a string literal}}} } -void check_NSAssert() { +void check_NSAssert(void) { NSAssert(@"Hello %@", @"World"); // no-warning MyNSAssert(@"Hello %@", @"World"); // expected-warning {{data argument not used by format string}} } @@ -153,7 +153,7 @@ typedef __WCHAR_TYPE__ wchar_t; // Test that %S, %C, %ls check for 16 bit types in ObjC strings, as described at // http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265 -void test_percent_S() { +void test_percent_S(void) { const unsigned short data[] = { 'a', 'b', 0 }; const unsigned short* ptr = data; NSLog(@"%S", ptr); // no-warning @@ -162,7 +162,7 @@ void test_percent_S() { NSLog(@"%S", wchar_ptr); // expected-warning{{format specifies type 'const unichar *' (aka 'const unsigned short *') but the argument has type 'const wchar_t *'}} } -void test_percent_ls() { +void test_percent_ls(void) { const unsigned short data[] = { 'a', 'b', 0 }; const unsigned short* ptr = data; NSLog(@"%ls", ptr); // no-warning @@ -171,7 +171,7 @@ void test_percent_ls() { NSLog(@"%ls", wchar_ptr); // expected-warning{{format specifies type 'const unichar *' (aka 'const unsigned short *') but the argument has type 'const wchar_t *'}} } -void test_percent_C() { +void test_percent_C(void) { const unsigned short data = 'a'; NSLog(@"%C", data); // no-warning @@ -213,14 +213,14 @@ void test_toll_free_bridging(CFStringRef x, id y) { // Test that it is okay to use %p with the address of a block. -void rdar11049844_aux(); -int rdar11049844() { +void rdar11049844_aux(void); +int rdar11049844(void) { typedef void (^MyBlock)(void); - MyBlock x = ^void() { rdar11049844_aux(); }; + MyBlock x = ^void(void) { rdar11049844_aux(); }; printf("%p", x); // no-warning } -void test_nonBuiltinCFStrings() { +void test_nonBuiltinCFStrings(void) { CFStringCreateWithFormat(__CFStringMakeConstantString("%@"), 1); // expected-warning{{format specifies type 'id' but the argument has type 'int'}} } @@ -256,13 +256,13 @@ void testTypeOf(NSInteger dW, NSInteger dH) { NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{format specifies type 'int' but the argument has type 'long'}} } -void testUnicode() { +void testUnicode(void) { NSLog(@"%C", 0x2022); // no-warning NSLog(@"%C", 0x202200); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}} } // Test Objective-C modifier flags. -void testObjCModifierFlags() { +void testObjCModifierFlags(void) { NSLog(@"%[]@", @"Foo"); // expected-warning {{missing object format flag}} NSLog(@"%[", @"Foo"); // expected-warning {{incomplete format specifier}} NSLog(@"%[tt", @"Foo"); // expected-warning {{incomplete format specifier}} diff --git a/clang/test/SemaObjC/gc-attributes.m b/clang/test/SemaObjC/gc-attributes.m index 8bc5c6a..1b81caf 100644 --- a/clang/test/SemaObjC/gc-attributes.m +++ b/clang/test/SemaObjC/gc-attributes.m @@ -5,7 +5,7 @@ void f0(__strong A**); // expected-note{{passing argument to parameter here}} -void test_f0() { +void test_f0(void) { A *a; static __weak A *a2; f0(&a); @@ -14,7 +14,7 @@ void test_f0() { void f1(__weak A**); // expected-note{{passing argument to parameter here}} -void test_f1() { +void test_f1(void) { A *a; __strong A *a2; f1(&a); diff --git a/clang/test/SemaObjC/iboutlet.m b/clang/test/SemaObjC/iboutlet.m index 1d8ec99..e7d8494 100644 --- a/clang/test/SemaObjC/iboutlet.m +++ b/clang/test/SemaObjC/iboutlet.m @@ -45,7 +45,7 @@ IBInspectable @property (readonly) IBOutlet NSView *myView1; // expected-warning @property IBOutlet __weak WeakOutlet* WeakProp; @end -WeakOutlet* func() { +WeakOutlet* func(void) { __weak WeakOutlet* pwi; pwi.WeakProp = (WeakOutlet*)0; pwi.WeakProp = pwi.WeakProp; diff --git a/clang/test/SemaObjC/id.m b/clang/test/SemaObjC/id.m index ced406e..a09f49a 100644 --- a/clang/test/SemaObjC/id.m +++ b/clang/test/SemaObjC/id.m @@ -5,7 +5,7 @@ Class T; id S; id R; -void foo() { +void foo(void) { // Test assignment compatibility of Class and id. No warning should be // produced. // rdar://6770142 - Class and id are compatible. diff --git a/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m b/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m index 996664f..1ed28c8 100644 --- a/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m +++ b/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m @@ -12,7 +12,7 @@ void takeId(id test) {} void takeCopyableId(id test) {} -id Test () { +id Test (void) { NSString const *constantString = @"Test"; takeId(constantString); takeCopyableId(constantString); diff --git a/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m b/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m index 23c7b96..3650f45 100644 --- a/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m +++ b/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m @@ -8,15 +8,15 @@ typedef const struct __CFString *CFStringRef; @interface NSString @end -CFTypeRef CFCreateSomething(); -CFStringRef CFCreateString(); -CFTypeRef CFGetSomething(); -CFStringRef CFGetString(); +CFTypeRef CFCreateSomething(void); +CFStringRef CFCreateString(void); +CFTypeRef CFGetSomething(void); +CFStringRef CFGetString(void); -id CreateSomething(); -NSString *CreateNSString(); +id CreateSomething(void); +NSString *CreateNSString(void); -void from_cf() { +void from_cf(void) { id obj1 = (__bridge_transfer id)CFCreateSomething(); // expected-warning {{'__bridge_transfer' casts have no effect when not using ARC}} id obj2 = (__bridge_transfer NSString*)CFCreateString(); // expected-warning {{'__bridge_transfer' casts have no effect when not using ARC}} (__bridge int*)CFCreateSomething(); // expected-warning {{expression result unused}} expected-warning {{cast from 'const void *' to 'int *' drops const qualifier}} @@ -31,7 +31,7 @@ void to_cf(id obj) { CFStringRef cf4 = (__bridge CFStringRef)CreateNSString(); } -void fixits() { +void fixits(void) { id obj1 = (id)CFCreateSomething(); CFTypeRef cf1 = (CFTypeRef)CreateSomething(); } @@ -45,7 +45,7 @@ void to_cf_ignored(id obj) { // Check that clang doesn't warn about dropping const from Objective-C object // types. -void test_wcast_qual() { +void test_wcast_qual(void) { CFStringRef c; NSString *n0 = (NSString *)c; NSString **n1 = (NSString **)&c; diff --git a/clang/test/SemaObjC/infer-availability-from-init.m b/clang/test/SemaObjC/infer-availability-from-init.m index 6719400..0c16708 100644 --- a/clang/test/SemaObjC/infer-availability-from-init.m +++ b/clang/test/SemaObjC/infer-availability-from-init.m @@ -10,7 +10,7 @@ __attribute__((objc_root_class)) -(instancetype)init __attribute__((unavailable)); // expected-note{{'init' has been explicitly marked unavailable here}} @end -void usemyobject() { +void usemyobject(void) { [MyObject new]; // expected-error{{'new' is unavailable}} } @@ -19,7 +19,7 @@ void usemyobject() { +(instancetype)new; @end -void usemyotherobject() { +void usemyotherobject(void) { [MyOtherObject new]; // no error; new is overrideen. } @@ -29,7 +29,7 @@ void usemyotherobject() { +(instancetype)new: (int)x; @end -void usenotgoodoverride() { +void usenotgoodoverride(void) { [NotGoodOverride new]; // no error } @@ -42,7 +42,7 @@ void usenotgoodoverride() { -(instancetype)init __attribute__((unavailable)); @end -void usenotmyobject() { +void usenotmyobject(void) { [NotMyObject new]; // no error; this isn't NSObject } diff --git a/clang/test/SemaObjC/instancetype.m b/clang/test/SemaObjC/instancetype.m index 59a6724..3e383ef 100644 --- a/clang/test/SemaObjC/instancetype.m +++ b/clang/test/SemaObjC/instancetype.m @@ -37,13 +37,13 @@ @end // Check the basic initialization pattern. -void test_instancetype_alloc_init_simple() { +void test_instancetype_alloc_init_simple(void) { Root *r1 = [[Root alloc] init]; Subclass1 *sc1 = [[Subclass1 alloc] init]; } // Test that message sends to instancetype methods have the right type. -void test_instancetype_narrow_method_search() { +void test_instancetype_narrow_method_search(void) { // instancetype on class methods Subclass1 *sc1 = [[Subclass1 alloc] initSubclass2]; // expected-warning{{'Subclass1' may not respond to 'initSubclass2'}} Subclass2 *sc2 = [[Subclass2 alloc] initSubclass2]; // okay @@ -156,7 +156,7 @@ void test_instancetype_narrow_method_search() { // Check that inherited related return types influence the types of // message sends. -void test_instancetype_inherited() { +void test_instancetype_inherited(void) { [[Subclass4 alloc] initSubclass1]; // expected-warning{{'Subclass4' may not respond to 'initSubclass1'}} [[Subclass4 alloc] initOther]; } diff --git a/clang/test/SemaObjC/interface-1.m b/clang/test/SemaObjC/interface-1.m index 0e47fa0..1643270 100644 --- a/clang/test/SemaObjC/interface-1.m +++ b/clang/test/SemaObjC/interface-1.m @@ -19,7 +19,7 @@ NSObject // expected-error {{cannot find interface declaration for 'NSObject @interface INT1 @end -void test2() { +void test2(void) { // rdar://6827200 INT1 b[3]; // expected-error {{array of interface 'INT1' is invalid (probably should be an array of pointers)}} INT1 *c = &b[0]; diff --git a/clang/test/SemaObjC/invalid-code.m b/clang/test/SemaObjC/invalid-code.m index 290f9d5..dc15d4a 100644 --- a/clang/test/SemaObjC/invalid-code.m +++ b/clang/test/SemaObjC/invalid-code.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions -Wno-objc-root-class %s // rdar://6124613 -void test1() { +void test1(void) { void *xyzzy = 0; void *p = @xyzzy; // expected-error {{unexpected '@' in program}} } @@ -16,7 +16,7 @@ void test1() { // // This previously triggered a crash because a ';' was expected after the @throw statement. -void foo() { +void foo(void) { @throw (id)0 // expected-error{{expected ';' after @throw}} } diff --git a/clang/test/SemaObjC/invalid-receiver.m b/clang/test/SemaObjC/invalid-receiver.m index 1174dd2..1742993 100644 --- a/clang/test/SemaObjC/invalid-receiver.m +++ b/clang/test/SemaObjC/invalid-receiver.m @@ -4,6 +4,6 @@ typedef struct NotAClass { int a, b; } NotAClass; -void foo() { +void foo(void) { [NotAClass nonexistent_method]; // expected-error {{receiver type 'NotAClass' (aka 'struct NotAClass') is not an Objective-C class}} } diff --git a/clang/test/SemaObjC/ivar-sem-check-1.m b/clang/test/SemaObjC/ivar-sem-check-1.m index 9e28a38..0a9971a 100644 --- a/clang/test/SemaObjC/ivar-sem-check-1.m +++ b/clang/test/SemaObjC/ivar-sem-check-1.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s struct S; // expected-note{{forward declaration of 'struct S'}} -typedef int FOO(); +typedef int FOO(void); @interface INTF { diff --git a/clang/test/SemaObjC/kindof.m b/clang/test/SemaObjC/kindof.m index b2c3205..1462814 100644 --- a/clang/test/SemaObjC/kindof.m +++ b/clang/test/SemaObjC/kindof.m @@ -316,7 +316,7 @@ void test(__kindof Bar *kBar) { @interface B : NSObject @property (getter=isActive, readonly) BOOL active; @end -void foo() { +void foo(void) { __kindof B *NSApp; if ([NSApp isActive]) { } @@ -365,9 +365,9 @@ void implicit_convert_array(NSArray<__kindof NSString *> *kindofStringsArray, // __kindof + nullability // --------------------------------------------------------------------------- -void testNullability() { +void testNullability(void) { // The base type being a pointer type tickles the bug. - extern __kindof id _Nonnull getSomeCopyable(); + extern __kindof id _Nonnull getSomeCopyable(void); NSString *string = getSomeCopyable(); // no-warning void processCopyable(__typeof(getSomeCopyable()) string); @@ -416,7 +416,7 @@ void testGeneric(NSGeneric *generic) { [generic test:NSString_str]; } -void testGenericAssignment() { +void testGenericAssignment(void) { NSMutableString *NSMutableString_str; NSNumber *NSNumber_obj; @@ -446,7 +446,7 @@ void testGenericAssignment() { NSNumber_obj = typedef_generic.kindof_object; // expected-warning{{incompatible pointer types assigning to 'NSNumber *' from '__kindof Typedef_NSString'}} } -void testKindofNonObjectType() { +void testKindofNonObjectType(void) { typedef void (^BlockType)(int); NSGeneric *generic; } diff --git a/clang/test/SemaObjC/legacy-implementation-1.m b/clang/test/SemaObjC/legacy-implementation-1.m index 2e4c5ae..38c06ec 100644 --- a/clang/test/SemaObjC/legacy-implementation-1.m +++ b/clang/test/SemaObjC/legacy-implementation-1.m @@ -5,7 +5,7 @@ INTF* pi; -INTF* FUNC() +INTF* FUNC(void) { return pi; } diff --git a/clang/test/SemaObjC/message.m b/clang/test/SemaObjC/message.m index 2c4d806..ae4bfb3 100644 --- a/clang/test/SemaObjC/message.m +++ b/clang/test/SemaObjC/message.m @@ -74,7 +74,7 @@ int f0(I0 *ob) { [ ob nonVararg: 0, 1, 2]; // expected-error {{too many arguments to method call}} } -int f2() { +int f2(void) { const id foo; [foo bar]; // expected-warning {{method '-bar' not found (return type defaults to 'id')}} return 0; @@ -92,7 +92,7 @@ int test5(int X) { } // PR4021 -void foo4() { +void foo4(void) { struct objc_object X[10]; [X rect]; // expected-warning {{receiver type 'struct objc_object *' is not 'id' or interface pointer, consider casting it to 'id'}} diff --git a/clang/test/SemaObjC/method-arg-qualifier-warning.m b/clang/test/SemaObjC/method-arg-qualifier-warning.m index 690509e..c198786 100644 --- a/clang/test/SemaObjC/method-arg-qualifier-warning.m +++ b/clang/test/SemaObjC/method-arg-qualifier-warning.m @@ -10,7 +10,7 @@ static const NSString * Identifier1 = @"Identifier1"; static NSString const * Identifier2 = @"Identifier2"; static NSString * const Identifier3 = @"Identifier3"; -int main () { +int main (void) { [@"Identifier1" isEqualToString:Identifier1]; // expected-warning {{sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers}} [@"Identifier2" isEqualToString:Identifier2]; // expected-warning {{sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers}} diff --git a/clang/test/SemaObjC/method-bad-param.m b/clang/test/SemaObjC/method-bad-param.m index f70f2cf..6193136 100644 --- a/clang/test/SemaObjC/method-bad-param.m +++ b/clang/test/SemaObjC/method-bad-param.m @@ -27,7 +27,7 @@ void func_with_bad_call(bar* b, foo* f) { } void somefunc(foo x) {} // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}} -foo somefunc2() {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}} +foo somefunc2(void) {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}} // rdar://6780761 void f0(foo *a0) { @@ -50,7 +50,7 @@ enum bogus; // expected-note {{forward declaration of 'enum bogus'}} @interface arrayfun - (int[6])arrayRet; // expected-error {{function cannot return array type 'int[6]'}} -- (int())funcRet; // expected-error {{function cannot return function type 'int ()'}} +- (int(void))funcRet; // expected-error {{function cannot return function type 'int (void)'}} @end @interface qux diff --git a/clang/test/SemaObjC/method-not-defined.m b/clang/test/SemaObjC/method-not-defined.m index 792469b..e638399 100644 --- a/clang/test/SemaObjC/method-not-defined.m +++ b/clang/test/SemaObjC/method-not-defined.m @@ -3,7 +3,7 @@ @interface Foo // expected-note {{receiver is instance of class declared here}} @end -void test() { +void test(void) { Foo *fooObj; id obj; diff --git a/clang/test/SemaObjC/method-sentinel-attr.m b/clang/test/SemaObjC/method-sentinel-attr.m index 82ee373..12e0e4c 100644 --- a/clang/test/SemaObjC/method-sentinel-attr.m +++ b/clang/test/SemaObjC/method-sentinel-attr.m @@ -23,7 +23,7 @@ - (id) foo16 : (id**)firstObj, ... __attribute__((sentinel(0,1))); @end -int main () +int main (void) { INTF *p; diff --git a/clang/test/SemaObjC/mrc-weak.m b/clang/test/SemaObjC/mrc-weak.m index e5f407c..07dd92f 100644 --- a/clang/test/SemaObjC/mrc-weak.m +++ b/clang/test/SemaObjC/mrc-weak.m @@ -41,7 +41,7 @@ __attribute__((objc_root_class)) @synthesize sd = _sd; @end -void test_goto() { +void test_goto(void) { goto after; // expected-error {{cannot jump from this goto statement to its label}} __weak id x; // expected-note {{jump bypasses initialization of __weak variable}}} after: diff --git a/clang/test/SemaObjC/no-objc-exceptions.m b/clang/test/SemaObjC/no-objc-exceptions.m index d47f51a..d323ca3 100644 --- a/clang/test/SemaObjC/no-objc-exceptions.m +++ b/clang/test/SemaObjC/no-objc-exceptions.m @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -void f() { +void f(void) { @throw @"Hello"; // expected-error {{cannot use '@throw' with Objective-C exceptions disabled}} } -void g() { +void g(void) { @try { // expected-error {{cannot use '@try' with Objective-C exceptions disabled}} f(); } @finally { diff --git a/clang/test/SemaObjC/ns_returns_retained_block_return.m b/clang/test/SemaObjC/ns_returns_retained_block_return.m index e5a96ca..d3c9b7b 100644 --- a/clang/test/SemaObjC/ns_returns_retained_block_return.m +++ b/clang/test/SemaObjC/ns_returns_retained_block_return.m @@ -5,18 +5,18 @@ // expected-no-diagnostics // rdar://17259812 -typedef void (^BT) (); +typedef void (^BT) (void); -BT foo() __attribute__((ns_returns_retained)); +BT foo(void) __attribute__((ns_returns_retained)); @interface I -BT foo() __attribute__((ns_returns_retained)); +BT foo(void) __attribute__((ns_returns_retained)); - (BT) Meth __attribute__((ns_returns_retained)); + (BT) ClsMeth __attribute__((ns_returns_retained)); @end @implementation I -BT foo() __attribute__((ns_returns_retained)) {return ^{}; } +BT foo(void) __attribute__((ns_returns_retained)) {return ^{}; } - (BT) Meth {return ^{}; } + (BT) ClsMeth {return ^{}; } @end diff --git a/clang/test/SemaObjC/nsobject-attribute.m b/clang/test/SemaObjC/nsobject-attribute.m index 7c8d75d..b013c9d 100644 --- a/clang/test/SemaObjC/nsobject-attribute.m +++ b/clang/test/SemaObjC/nsobject-attribute.m @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) { // @property (nonatomic, retain) __attribute__((NSObject)) CGColorRefNoNSObject color; // // no-warning @end -void test_10453342() { +void test_10453342(void) { char* __attribute__((NSObject)) string2 = 0; // expected-warning {{'NSObject' attribute may be put on a typedef only; attribute is ignored}} } diff --git a/clang/test/SemaObjC/nullability.m b/clang/test/SemaObjC/nullability.m index 3817289..d8ec24f 100644 --- a/clang/test/SemaObjC/nullability.m +++ b/clang/test/SemaObjC/nullability.m @@ -231,7 +231,7 @@ void testMultiProp(MultiProp *foo) { ip = foo.e; // expected-error{{incompatible type 'MultiProp *(^ _Nullable)(int)'}} } -void testBlockLiterals() { +void testBlockLiterals(void) { (void)(^id(void) { return 0; }); (void)(^id _Nullable (void) { return 0; }); (void)(^ _Nullable id(void) { return 0; }); diff --git a/clang/test/SemaObjC/nullable-result.m b/clang/test/SemaObjC/nullable-result.m index 9958531..6125141 100644 --- a/clang/test/SemaObjC/nullable-result.m +++ b/clang/test/SemaObjC/nullable-result.m @@ -15,7 +15,7 @@ void call(SomeClass *sc) { [sc async_get:^(X *_Nullable rptr, NSError *err) {}]; } -void test_conversion() { +void test_conversion(void) { X *_Nullable_result nr; X *_Nonnull l = nr; // expected-warning{{implicit conversion from nullable pointer 'X * _Nullable_result' to non-nullable pointer type 'X * _Nonnull'}} @@ -24,7 +24,7 @@ void test_conversion() { }; } -void test_dup() { +void test_dup(void) { id _Nullable_result _Nullable_result a; // expected-warning {{duplicate nullability specifier _Nullable_result}} id _Nullable _Nullable_result b; // expected-error{{nullability specifier _Nullable_result conflicts with existing specifier '_Nullable'}} id _Nullable_result _Nonnull c; // expected-error{{nullability specifier '_Nonnull' conflicts with existing specifier _Nullable_result}} diff --git a/clang/test/SemaObjC/objc-array-literal.m b/clang/test/SemaObjC/objc-array-literal.m index c0a0c67..9c9f696 100644 --- a/clang/test/SemaObjC/objc-array-literal.m +++ b/clang/test/SemaObjC/objc-array-literal.m @@ -9,14 +9,14 @@ typedef unsigned long NSUInteger; typedef unsigned int NSUInteger; #endif -void checkNSArrayUnavailableDiagnostic() { +void checkNSArrayUnavailableDiagnostic(void) { id obj; id arr = @[obj]; // expected-error {{definition of class NSArray must be available to use Objective-C array literals}} } @class NSArray; // expected-note {{forward declaration of class here}} -void checkNSArrayFDDiagnostic() { +void checkNSArrayFDDiagnostic(void) { id obj; id arr = @[obj]; // expected-error {{definition of class NSArray must be available to use Objective-C array literals}} } @@ -42,7 +42,7 @@ extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, @end -int main() { +int main(void) { NSArray *array = @[@"Hello", @"There", @"How Are You", [NSNumber numberWithInt:42]]; for (id string in array) @@ -55,11 +55,11 @@ int main() { } // rdar://14303083 -id Test14303083() { +id Test14303083(void) { id obj = @[ @"A", (@"B" @"C")]; return @[ @"A", @"B" @"C"]; // expected-warning {{concatenated NSString literal for an NSArray expression - possibly missing a comma}} } -id radar15147688() { +id radar15147688(void) { #define R15147688_A @"hello" #define R15147688_B "world" #define CONCATSTR R15147688_A R15147688_B @@ -69,7 +69,7 @@ id radar15147688() { } enum XXXYYYZZZType { XXXYYYZZZTypeAny }; // expected-note {{'XXXYYYZZZTypeAny' declared here}} -void foo() { +void foo(void) { NSArray *array = @[ @(XXXYYYZZZTypeA), // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeA'; did you mean 'XXXYYYZZZTypeAny'}} @(XXXYYYZZZTypeSomethingSomething) // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeSomethingSomething'}} diff --git a/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m b/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m index f5ef55e..73ef016 100644 --- a/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m +++ b/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m @@ -44,7 +44,7 @@ typedef union BOXABLE _BoxableUnion { int dummy; } BoxableUnion; -void checkNSValueDiagnostic() { +void checkNSValueDiagnostic(void) { NSRect rect; id value = @(rect); // expected-error{{definition of class NSValue must be available to use Objective-C boxed expressions}} } @@ -53,7 +53,7 @@ void checkNSValueDiagnostic() { + (NSValue *)valueWithBytes:(const void *)value objCType:(const char *)type; @end -int main() { +int main(void) { NSPoint ns_point; id ns_point_value = @(ns_point); @@ -85,17 +85,17 @@ int main() { id err = @(s); // expected-error{{illegal type 'SomeStruct' (aka 'struct _SomeStruct') used in a boxed expression}} } -CGRect getRect() { +CGRect getRect(void) { CGRect r; return r; } -SomeStruct getSomeStruct() { +SomeStruct getSomeStruct(void) { SomeStruct s; return s; } -void rvalue() { +void rvalue(void) { id rv_rect = @(getRect()); id rv_some_struct = @(getSomeStruct()); // expected-error {{illegal type 'SomeStruct' (aka 'struct _SomeStruct') used in a boxed expression}} } diff --git a/clang/test/SemaObjC/objc-buffered-methods.m b/clang/test/SemaObjC/objc-buffered-methods.m index 55e4897..bd4162c 100644 --- a/clang/test/SemaObjC/objc-buffered-methods.m +++ b/clang/test/SemaObjC/objc-buffered-methods.m @@ -12,7 +12,7 @@ int* global; @implementation I + (void) _defaultMinSize { }; -static void _initCommon() { +static void _initCommon(void) { Class graphicClass; [graphicClass _defaultMinSize]; } diff --git a/clang/test/SemaObjC/objc-class-property.m b/clang/test/SemaObjC/objc-class-property.m index f8d4911..a7a4580 100644 --- a/clang/test/SemaObjC/objc-class-property.m +++ b/clang/test/SemaObjC/objc-class-property.m @@ -35,13 +35,13 @@ @dynamic customGetterProperty; @end -int test() { +int test(void) { A *a = [[A alloc] init]; a.c; // expected-error {{property 'c' is a class property; did you mean to access it with class 'A'}} return a.x + A.c; } -void customSelectors() { +void customSelectors(void) { A.customSetterProperty = 1; (void)A.customGetterProperty; } diff --git a/clang/test/SemaObjC/objc-container-subscripting-1.m b/clang/test/SemaObjC/objc-container-subscripting-1.m index b5ed5a6..04713c9 100644 --- a/clang/test/SemaObjC/objc-container-subscripting-1.m +++ b/clang/test/SemaObjC/objc-container-subscripting-1.m @@ -9,7 +9,7 @@ typedef unsigned int size_t; @interface XNSMutableArray @end -int main() { +int main(void) { id array; id oldObject = array[10]; // expected-warning {{instance method '-objectAtIndexedSubscript:' not found (return type defaults to 'id')}} diff --git a/clang/test/SemaObjC/objc-container-subscripting-2.m b/clang/test/SemaObjC/objc-container-subscripting-2.m index 6e7ee7c..7c06640 100644 --- a/clang/test/SemaObjC/objc-container-subscripting-2.m +++ b/clang/test/SemaObjC/objc-container-subscripting-2.m @@ -13,14 +13,14 @@ typedef unsigned int size_t; - (void)setObject:(id)object forKeyedSubscript:(size_t)key; @end -id func() { +id func(void) { NSMutableArray *array; float f; array[f] = array; // expected-error {{indexing expression is invalid because subscript type 'float' is not an integral or Objective-C pointer type}} return array[3.14]; // expected-error {{indexing expression is invalid because subscript type 'double' is not an integral or Objective-C pointer type}} } -void test_unused() { +void test_unused(void) { NSMutableArray *array; array[10]; // expected-warning {{container access result unused - container access should not be used for side effects}} diff --git a/clang/test/SemaObjC/objc-container-subscripting-3.m b/clang/test/SemaObjC/objc-container-subscripting-3.m index 2f716d6..d276d96 100644 --- a/clang/test/SemaObjC/objc-container-subscripting-3.m +++ b/clang/test/SemaObjC/objc-container-subscripting-3.m @@ -11,7 +11,7 @@ - (void)setObject:(int)object forKeyedSubscript:(id)key; // expected-note {{parameter of type 'int' is declared here}} @end -int main() { +int main(void) { Test *array; int i = array[10]; // expected-error {{method for accessing array element must have Objective-C object return type instead of 'int'}} array[2] = i; // expected-error {{cannot assign to this array because assigning method's 2nd parameter of type 'int' is not an Objective-C pointer type}} diff --git a/clang/test/SemaObjC/objc-container-subscripting.m b/clang/test/SemaObjC/objc-container-subscripting.m index 3bbd7d4..ae5326e 100644 --- a/clang/test/SemaObjC/objc-container-subscripting.m +++ b/clang/test/SemaObjC/objc-container-subscripting.m @@ -10,7 +10,7 @@ typedef unsigned int size_t; @end @interface I @end -int main() { +int main(void) { NSMutableArray

* array; id oldObject = array[10]; // expected-error {{method index parameter type 'double' is not integral type}} array[3] = 0; // expected-error {{method index parameter type 'void *' is not integral type}} \ @@ -32,7 +32,7 @@ int main() { @end @class NSString; -void testDict() { +void testDict(void) { NSMutableDictionary *dictionary; NSString *key; id newObject, oldObject; diff --git a/clang/test/SemaObjC/objc-cstyle-args-in-methods.m b/clang/test/SemaObjC/objc-cstyle-args-in-methods.m index ebc7192..86df8fd 100644 --- a/clang/test/SemaObjC/objc-cstyle-args-in-methods.m +++ b/clang/test/SemaObjC/objc-cstyle-args-in-methods.m @@ -11,7 +11,7 @@ @end -int main() { +int main(void) { Foo *foo; [foo test:@"One", @"Two"]; [foo bad:@"One", @"Two"]; // expected-error {{too few arguments to method call}} diff --git a/clang/test/SemaObjC/objc-dictionary-literal.m b/clang/test/SemaObjC/objc-dictionary-literal.m index ce301a0..92edb05 100644 --- a/clang/test/SemaObjC/objc-dictionary-literal.m +++ b/clang/test/SemaObjC/objc-dictionary-literal.m @@ -5,7 +5,7 @@ #define nil ((void *)0) -void checkNSDictionaryUnavailableDiagnostic() { +void checkNSDictionaryUnavailableDiagnostic(void) { id key; id value; id dict = @{ key : value }; // expected-error {{definition of class NSDictionary must be available to use Objective-C dictionary literals}} @@ -13,7 +13,7 @@ void checkNSDictionaryUnavailableDiagnostic() { @class NSDictionary; // expected-note {{forward declaration of class here}} -void checkNSDictionaryFDDiagnostic() { +void checkNSDictionaryFDDiagnostic(void) { id key; id value; id dic = @{ key : value }; // expected-error {{definition of class NSDictionary must be available to use Objective-C dictionary literals}} @@ -43,7 +43,7 @@ typedef long NSInteger; @end void *pvoid; -int main() { +int main(void) { NSDictionary *dict = @{ @"name":@666 }; dict[@"name"] = @666; @@ -64,7 +64,7 @@ int main() { } enum XXXYYYZZZType { XXXYYYZZZTypeAny }; // expected-note {{'XXXYYYZZZTypeAny' declared here}} -void foo() { +void foo(void) { NSDictionary *d = @{ @"A" : @(XXXYYYZZZTypeA), // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeA'; did you mean 'XXXYYYZZZTypeAny'}} @"F" : @(XXXYYYZZZTypeSomethingSomething), // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeSomethingSomething'}} diff --git a/clang/test/SemaObjC/objc-independent-class-attribute.m b/clang/test/SemaObjC/objc-independent-class-attribute.m index 2fc13f0..e9f58b0 100644 --- a/clang/test/SemaObjC/objc-independent-class-attribute.m +++ b/clang/test/SemaObjC/objc-independent-class-attribute.m @@ -11,7 +11,7 @@ typedef struct { // expected-warning {{'objc_independent_class' attribute may be NSObject *__attribute__((objc_independent_class)) ns; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}} } __attribute__((objc_independent_class)) T; -dispatch_queue_t dispatch_queue_create(); +dispatch_queue_t dispatch_queue_create(void); @interface DispatchQPointerCastIssue : NSObject { NSObject *__attribute__((objc_independent_class)) Ivar; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}} @@ -29,7 +29,7 @@ typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t_1; } @end -NSObject *get_nsobject() { +NSObject *get_nsobject(void) { typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t; dispatch_queue_t dt; return dt; diff --git a/clang/test/SemaObjC/objc-literal-fixit.m b/clang/test/SemaObjC/objc-literal-fixit.m index fa117a3..7911d9f 100644 --- a/clang/test/SemaObjC/objc-literal-fixit.m +++ b/clang/test/SemaObjC/objc-literal-fixit.m @@ -13,7 +13,7 @@ typedef signed char BOOL; +(instancetype)numberWithBool:(BOOL)value; @end -void test() { +void test(void) { NSNumber *n = YES; // expected-error{{numeric literal must be prefixed by '@'}} NSNumber *n1 = 1; // expected-error{{numeric literal must be prefixed by '@'}} diff --git a/clang/test/SemaObjC/objc-literal-nsnumber.m b/clang/test/SemaObjC/objc-literal-nsnumber.m index ceb31f8..c452364 100644 --- a/clang/test/SemaObjC/objc-literal-nsnumber.m +++ b/clang/test/SemaObjC/objc-literal-nsnumber.m @@ -9,7 +9,7 @@ typedef unsigned int NSUInteger; typedef int NSInteger; #endif -void checkNSNumberUnavailableDiagnostic() { +void checkNSNumberUnavailableDiagnostic(void) { id num = @1000; // expected-error {{definition of class NSNumber must be available to use Objective-C numeric literals}} int x = 1000; @@ -19,7 +19,7 @@ void checkNSNumberUnavailableDiagnostic() { @class NSNumber; // expected-note 2 {{forward declaration of class here}} -void checkNSNumberFDDiagnostic() { +void checkNSNumberFDDiagnostic(void) { id num = @1000; // expected-error {{definition of class NSNumber must be available to use Objective-C numeric literals}} int x = 1000; @@ -50,7 +50,7 @@ void checkNSNumberFDDiagnostic() { // rdar://16417427 int big = 1391126400; int thousand = 1000; -int main() { +int main(void) { NSNumber * N = @3.1415926535; // expected-error {{declaration of 'numberWithDouble:' is missing in NSNumber class}} NSNumber *noNumber = @__objc_yes; // expected-error {{declaration of 'numberWithBool:' is missing in NSNumber class}} NSNumber * NInt = @1000; @@ -73,7 +73,7 @@ int main() { // Dictionary test @class NSDictionary; // expected-note {{forward declaration of class here}} -NSDictionary *err() { +NSDictionary *err(void) { return @{@"name" : @"value"}; // expected-error {{definition of class NSDictionary must be available to use Objective-C dictionary literals}} } @@ -92,15 +92,15 @@ NSDictionary *err() { @interface NSString @end -id NSUserName(); +id NSUserName(void); -int Int(); +int Int(void); -NSDictionary * blocks() { +NSDictionary * blocks(void) { return @{ @"task" : ^ { return 17; } }; } -NSDictionary * warn() { +NSDictionary * warn(void) { NSDictionary *dictionary = @{@"name" : NSUserName(), @"date" : [NSDate date], @"name2" : @"other", @@ -116,7 +116,7 @@ NSDictionary * warn() { // rdar:// 11231426 typedef float BOOL; -BOOL radar11231426() { +BOOL radar11231426(void) { return __objc_yes; } diff --git a/clang/test/SemaObjC/objc-literal-sig.m b/clang/test/SemaObjC/objc-literal-sig.m index 48f6916..146df19 100644 --- a/clang/test/SemaObjC/objc-literal-sig.m +++ b/clang/test/SemaObjC/objc-literal-sig.m @@ -41,7 +41,7 @@ typedef _Bool BOOL; // and then used un-checked. const char *getStr(void); -void test_sig() { +void test_sig(void) { (void)@__objc_yes; // expected-error{{literal construction method 'numberWithBool:' has incompatible signature}} (void)@__objc_yes; // expected-error{{literal construction method 'numberWithBool:' has incompatible signature}} id array = @[ @17 ]; // expected-error{{literal construction method 'arrayWithObjects:count:' has incompatible signature}} diff --git a/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m b/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m index 232f8dd..0a5a662 100644 --- a/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m +++ b/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m @@ -7,11 +7,11 @@ extern __strong INTF* p2; extern __strong id p1; extern id p1; -extern id CFRunLoopGetMain(); -extern __strong id CFRunLoopGetMain(); +extern id CFRunLoopGetMain(void); +extern __strong id CFRunLoopGetMain(void); -extern __weak id WLoopGetMain(); // expected-note {{previous declaration is here}} -extern id WLoopGetMain(); // expected-error {{conflicting types for 'WLoopGetMain'}} +extern __weak id WLoopGetMain(void); // expected-note {{previous declaration is here}} +extern id WLoopGetMain(void); // expected-error {{conflicting types for 'WLoopGetMain'}} extern id p3; // expected-note {{previous declaration is here}} extern __weak id p3; // expected-error {{redeclaration of 'p3' with a different type}} diff --git a/clang/test/SemaObjC/objc2-warn-weak-decl.m b/clang/test/SemaObjC/objc2-warn-weak-decl.m index b85f768..a29ff7b 100644 --- a/clang/test/SemaObjC/objc2-warn-weak-decl.m +++ b/clang/test/SemaObjC/objc2-warn-weak-decl.m @@ -4,7 +4,7 @@ struct S { __weak id p; // expected-warning {{__weak attribute cannot be specified on a field declaration}} }; -int main () +int main (void) { __weak id local; // expected-warning {{Objective-C GC does not allow weak variables on the stack}} } diff --git a/clang/test/SemaObjC/objcbridge-attribute.m b/clang/test/SemaObjC/objcbridge-attribute.m index c93543c..de6fbe9 100644 --- a/clang/test/SemaObjC/objcbridge-attribute.m +++ b/clang/test/SemaObjC/objcbridge-attribute.m @@ -135,10 +135,10 @@ void Test8(CFMyPersonalErrorRef cf) { (void)(id)cf; // expected-warning {{'CFMyPersonalErrorRef' (aka 'struct __CFMyPersonalErrorRef *') bridges to MyPersonalError, not 'id'}} } -CFDictionaryRef bar() __attribute__((cf_returns_not_retained)); +CFDictionaryRef bar(void) __attribute__((cf_returns_not_retained)); @class NSNumber; -void Test9() { +void Test9(void) { NSNumber *w2 = (NSNumber*) bar(); // expected-error {{CF object of type 'CFDictionaryRef' (aka 'struct __CFDictionary *') is bridged to 'NSDictionary', which is not an Objective-C class}} } diff --git a/clang/test/SemaObjC/opaque-is-access-warn.m b/clang/test/SemaObjC/opaque-is-access-warn.m index 4f86866..e5fdef6 100644 --- a/clang/test/SemaObjC/opaque-is-access-warn.m +++ b/clang/test/SemaObjC/opaque-is-access-warn.m @@ -17,7 +17,7 @@ typedef struct objc_object { +self; @end -static void func() { +static void func(void) { id x; diff --git a/clang/test/SemaObjC/opaque-is-access.m b/clang/test/SemaObjC/opaque-is-access.m index 89d91b3..ebb42eb 100644 --- a/clang/test/SemaObjC/opaque-is-access.m +++ b/clang/test/SemaObjC/opaque-is-access.m @@ -14,7 +14,7 @@ typedef struct objc_object { +self; @end -static void func() { +static void func(void) { id x; diff --git a/clang/test/SemaObjC/ovl-check.m b/clang/test/SemaObjC/ovl-check.m index cc2f094..b777c29 100644 --- a/clang/test/SemaObjC/ovl-check.m +++ b/clang/test/SemaObjC/ovl-check.m @@ -40,7 +40,7 @@ void testTakesNSString(id x) { [x testStr:"someStringLiteral"]; } -id CreateSomething(); +id CreateSomething(void); @interface TakesCFTypeRef - (void) testCFTypeRef:(CFTypeRef)arg; diff --git a/clang/test/SemaObjC/parameterized_classes.m b/clang/test/SemaObjC/parameterized_classes.m index 1004fd3..2b1dcc9 100644 --- a/clang/test/SemaObjC/parameterized_classes.m +++ b/clang/test/SemaObjC/parameterized_classes.m @@ -298,7 +298,7 @@ typedef typeArgs15 typeArgs16; // expected-error{{type a typedef typeArgs15 typeArgsAndProtocolQuals6; -void testSpecializedTypePrinting() { +void testSpecializedTypePrinting(void) { int *ip; ip = (typeArgs15*)0; // expected-warning{{'typeArgs15 *' (aka 'PC1 *')}} diff --git a/clang/test/SemaObjC/potentially-direct-selector.m b/clang/test/SemaObjC/potentially-direct-selector.m index 04f9d21..c5c9f39 100644 --- a/clang/test/SemaObjC/potentially-direct-selector.m +++ b/clang/test/SemaObjC/potentially-direct-selector.m @@ -79,7 +79,7 @@ __attribute__((objc_root_class)) } @end -void test2() { +void test2(void) { (void)@selector(inBase); // strict-warning{{@selector expression formed with potentially direct selector}} (void)@selector(inBaseImpl); // strict-warning{{@selector expression formed with potentially direct selector}} (void)@selector(inBaseCat); // strict-warning{{@selector expression formed with potentially direct selector}} diff --git a/clang/test/SemaObjC/property-10.m b/clang/test/SemaObjC/property-10.m index 7bd0d3b..f35e936 100644 --- a/clang/test/SemaObjC/property-10.m +++ b/clang/test/SemaObjC/property-10.m @@ -26,16 +26,16 @@ @property id p4; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for object}} -@property(nonatomic,copy) int (^includeMailboxCondition)(); -@property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}} +@property(nonatomic,copy) int (^includeMailboxCondition)(void); +@property(nonatomic,copy) int (*includeMailboxCondition2)(void); // expected-error {{property with 'copy' attribute must be of object type}} @end @interface I0() @property (retain) int PROP; // expected-error {{property with 'retain (or strong)' attribute must be of object type}} @property (strong) int SPROP; // expected-error {{property with 'retain (or strong)' attribute must be of object type}} -@property(nonatomic,copy) int (*PROP1)(); // expected-error {{property with 'copy' attribute must be of object type}} -@property(nonatomic,weak) int (*PROP2)(); // expected-error {{property with 'weak' attribute must be of object type}} +@property(nonatomic,copy) int (*PROP1)(void); // expected-error {{property with 'copy' attribute must be of object type}} +@property(nonatomic,weak) int (*PROP2)(void); // expected-error {{property with 'weak' attribute must be of object type}} @end // rdar://10357768 diff --git a/clang/test/SemaObjC/property-13.m b/clang/test/SemaObjC/property-13.m index 362d6d3..6f6dd0a 100644 --- a/clang/test/SemaObjC/property-13.m +++ b/clang/test/SemaObjC/property-13.m @@ -46,7 +46,7 @@ @end void abort(void); -int main () +int main (void) { Test *x = [[Test alloc] init]; /* 1. Test of a required property */ diff --git a/clang/test/SemaObjC/property-error-readonly-assign.m b/clang/test/SemaObjC/property-error-readonly-assign.m index 3484172..8b9b49a 100644 --- a/clang/test/SemaObjC/property-error-readonly-assign.m +++ b/clang/test/SemaObjC/property-error-readonly-assign.m @@ -23,7 +23,7 @@ typedef struct { int i1, i2; } NSRect; -NSRect NSMakeRect(); +NSRect NSMakeRect(void); @interface NSWindow { diff --git a/clang/test/SemaObjC/property-expression-error.m b/clang/test/SemaObjC/property-expression-error.m index e306722..60a4966 100644 --- a/clang/test/SemaObjC/property-expression-error.m +++ b/clang/test/SemaObjC/property-expression-error.m @@ -11,13 +11,13 @@ @synthesize index; @end -int main() { +int main(void) { AddressMyProperties *object; &object.index; // expected-error {{address of property expression requested}} return 0; } typedef int Foo; -void test() { +void test(void) { Foo.x; // expected-error {{expected identifier or '('}} } diff --git a/clang/test/SemaObjC/property-in-class-extension.m b/clang/test/SemaObjC/property-in-class-extension.m index a780a35..eefc0df4 100644 --- a/clang/test/SemaObjC/property-in-class-extension.m +++ b/clang/test/SemaObjC/property-in-class-extension.m @@ -7,7 +7,7 @@ @property (readonly) int bar; @end -void FUNC () { +void FUNC (void) { Foo *foo; foo.bar = 0; // expected-error {{assignment to readonly property}} } diff --git a/clang/test/SemaObjC/property-not-lvalue.m b/clang/test/SemaObjC/property-not-lvalue.m index 12d2cc6..4f8301b 100644 --- a/clang/test/SemaObjC/property-not-lvalue.m +++ b/clang/test/SemaObjC/property-not-lvalue.m @@ -13,7 +13,7 @@ typedef struct NSSize { @property NSSize size; @end -void foo() { +void foo(void) { Foo *f; f.size.width = 2.2; // expected-error {{expression is not assignable}} f.size.inner.dim = 200; // expected-error {{expression is not assignable}} diff --git a/clang/test/SemaObjC/property.m b/clang/test/SemaObjC/property.m index b67ac37..b03aea3 100644 --- a/clang/test/SemaObjC/property.m +++ b/clang/test/SemaObjC/property.m @@ -39,7 +39,7 @@ @property double bar; @end -int func1() { +int func1(void) { id foo; double bar = [foo bar]; return 0; @@ -66,7 +66,7 @@ typedef id BYObjectIdentifier; @synthesize window; // expected-error {{missing context for property implementation declaration}} // rdar://10408414 -Class test6_getClass(); +Class test6_getClass(void); @interface Test6 @end @implementation Test6 diff --git a/clang/test/SemaObjC/protocol-attribute.m b/clang/test/SemaObjC/protocol-attribute.m index 52bd441..3ca4ef6 100644 --- a/clang/test/SemaObjC/protocol-attribute.m +++ b/clang/test/SemaObjC/protocol-attribute.m @@ -42,7 +42,7 @@ __attribute ((unavailable)) __attribute ((deprecated)) @protocol XProto; // expe id idX = 0; // expected-error {{'XProto' is unavailable}} -int main () +int main (void) { MyClass1 *p1; // expected-warning {{'MyProto1' is deprecated}} } diff --git a/clang/test/SemaObjC/protocol-expr-1.m b/clang/test/SemaObjC/protocol-expr-1.m index 5ff3db4..cefe9a9 100644 --- a/clang/test/SemaObjC/protocol-expr-1.m +++ b/clang/test/SemaObjC/protocol-expr-1.m @@ -8,7 +8,7 @@ @class cl; -int main() +int main(void) { Protocol *proto = @protocol(p1); Protocol *fproto = @protocol(fproto); diff --git a/clang/test/SemaObjC/protocol-expr-neg-1.m b/clang/test/SemaObjC/protocol-expr-neg-1.m index f659b30..d5767eb 100644 --- a/clang/test/SemaObjC/protocol-expr-neg-1.m +++ b/clang/test/SemaObjC/protocol-expr-neg-1.m @@ -9,7 +9,7 @@ @class cl; -int main() +int main(void) { Protocol *proto = @protocol(p1); Protocol *fproto = @protocol(fproto); // expected-error {{@protocol is using a forward protocol declaration of 'fproto'}} diff --git a/clang/test/SemaObjC/protocol-typecheck.m b/clang/test/SemaObjC/protocol-typecheck.m index 4eb1b26..0166cc3 100644 --- a/clang/test/SemaObjC/protocol-typecheck.m +++ b/clang/test/SemaObjC/protocol-typecheck.m @@ -13,7 +13,7 @@ @end -void func() { +void func(void) { NSObject * flexer; NSObject * flexer2; XX *obj; diff --git a/clang/test/SemaObjC/protocol-warn.m b/clang/test/SemaObjC/protocol-warn.m index 04df503..ca875b0 100644 --- a/clang/test/SemaObjC/protocol-warn.m +++ b/clang/test/SemaObjC/protocol-warn.m @@ -47,7 +47,7 @@ @implementation UIWebPDFView @end -UIWebPDFView *getView() +UIWebPDFView *getView(void) { UIWebBrowserView *browserView; UIWebPDFView *pdfView; diff --git a/clang/test/SemaObjC/rdar6248119.m b/clang/test/SemaObjC/rdar6248119.m index a495978..afde67b 100644 --- a/clang/test/SemaObjC/rdar6248119.m +++ b/clang/test/SemaObjC/rdar6248119.m @@ -3,7 +3,7 @@ // Test case for: // @finally doesn't introduce a new scope -void f0() { +void f0(void) { int i; @try { } @finally { @@ -11,7 +11,7 @@ void f0() { } } -void f1() { +void f1(void) { int i; @try { int i =0; @@ -19,7 +19,7 @@ void f1() { } } -void f2() { +void f2(void) { int i; @try { } @catch(id e) { diff --git a/clang/test/SemaObjC/related-result-type-inference.m b/clang/test/SemaObjC/related-result-type-inference.m index 547e83f..6b7e9c4 100644 --- a/clang/test/SemaObjC/related-result-type-inference.m +++ b/clang/test/SemaObjC/related-result-type-inference.m @@ -45,7 +45,7 @@ + (Unrelated *)newUnrelated; @end -void test_inference() { +void test_inference(void) { // Inference based on method family __typeof__(([[NSString alloc] init])) *str = (NSString**)0; __typeof__(([[[[NSString new] self] retain] autorelease])) *str2 = (NSString **)0; diff --git a/clang/test/SemaObjC/resolve-method-in-global-pool.m b/clang/test/SemaObjC/resolve-method-in-global-pool.m index 523856d..f74d6e2 100644 --- a/clang/test/SemaObjC/resolve-method-in-global-pool.m +++ b/clang/test/SemaObjC/resolve-method-in-global-pool.m @@ -57,7 +57,7 @@ extern id NSApp; @interface AppDelegate @end -AppDelegate* GetDelegate() +AppDelegate* GetDelegate(void) { return [NSApp delegate]; } diff --git a/clang/test/SemaObjC/return.m b/clang/test/SemaObjC/return.m index f69d41e..a4e6959 100644 --- a/clang/test/SemaObjC/return.m +++ b/clang/test/SemaObjC/return.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-noreturn -fobjc-exceptions -Wno-objc-root-class %s -int test1() { +int test1(void) { id a; @throw a; } @@ -25,7 +25,7 @@ void test3(int a) { // expected-warning {{function 'test3' could be declared wi // issue a noreturn warning. @class NSException; @class NSString; -NSString *rdar_4289832() { // no-warning +NSString *rdar_4289832(void) { // no-warning @try { return @"a"; diff --git a/clang/test/SemaObjC/scope-check.m b/clang/test/SemaObjC/scope-check.m index b23edd1..563dca0 100644 --- a/clang/test/SemaObjC/scope-check.m +++ b/clang/test/SemaObjC/scope-check.m @@ -2,7 +2,7 @@ @class A, B, C; -void test1() { +void test1(void) { goto L; // expected-error{{cannot jump}} goto L2; // expected-error{{cannot jump}} goto L3; // expected-error{{cannot jump}} @@ -64,7 +64,7 @@ void test2(int a) { } // rdar://6803963 -void test3() { +void test3(void) { @try { goto blargh; blargh: ; diff --git a/clang/test/SemaObjC/selector-1.m b/clang/test/SemaObjC/selector-1.m index 4efa0d7..e9d5f06 100644 --- a/clang/test/SemaObjC/selector-1.m +++ b/clang/test/SemaObjC/selector-1.m @@ -9,13 +9,13 @@ - (id) compare: (id) arg1; // expected-note {{method 'compare:' declared here}} @end -SEL func() +SEL func(void) { return @selector(compare:); // expected-warning {{several methods with selector 'compare:' of mismatched types are found for the @selector expression}} } // rdar://16458579 -void Test16458579() { +void Test16458579(void) { SEL s = @selector((retain)); SEL s1 = @selector((meth1:)); SEL s2 = @selector((retainArgument::)); @@ -26,7 +26,7 @@ void Test16458579() { SEL s7 = @selector((char:float:double:unsigned:short:long:)); SEL s9 = @selector((:enum:bool:)); } -int main() { +int main(void) { SEL s = @selector(retain); SEL s1 = @selector(meth1:); SEL s2 = @selector(retainArgument::); diff --git a/clang/test/SemaObjC/selector-2.m b/clang/test/SemaObjC/selector-2.m index 17d1872..0bd99fa 100644 --- a/clang/test/SemaObjC/selector-2.m +++ b/clang/test/SemaObjC/selector-2.m @@ -5,7 +5,7 @@ - length; @end -static inline SEL IsEmpty() { +static inline SEL IsEmpty(void) { return @selector(length); } diff --git a/clang/test/SemaObjC/selector-3.m b/clang/test/SemaObjC/selector-3.m index 80332ec..34dd724 100644 --- a/clang/test/SemaObjC/selector-3.m +++ b/clang/test/SemaObjC/selector-3.m @@ -23,7 +23,7 @@ - length; @end -SEL func() +SEL func(void) { return @selector(length); // expected-warning {{no method with selector 'length' is implemented in this translation unit}} } @@ -130,7 +130,7 @@ extern SEL MySelector(SEL s); } @end -void test16428638() { +void test16428638(void) { SEL s = @selector(compare:); (void)s; } diff --git a/clang/test/SemaObjC/selector-4.m b/clang/test/SemaObjC/selector-4.m index 59a8233..6369128 100644 --- a/clang/test/SemaObjC/selector-4.m +++ b/clang/test/SemaObjC/selector-4.m @@ -18,7 +18,7 @@ @end #else -int main() { +int main(void) { (void)@selector(compare:); } diff --git a/clang/test/SemaObjC/selector-overload.m b/clang/test/SemaObjC/selector-overload.m index 447607a..b34d98f 100644 --- a/clang/test/SemaObjC/selector-overload.m +++ b/clang/test/SemaObjC/selector-overload.m @@ -41,7 +41,7 @@ struct D { @end -int main() { +int main(void) { id xx = [[Car alloc] init]; // expected-warning {{incompatible types assigning 'int' to 'id'}} [xx method:4]; diff --git a/clang/test/SemaObjC/setter-dotsyntax.m b/clang/test/SemaObjC/setter-dotsyntax.m index ec47ee2..7e205ca 100644 --- a/clang/test/SemaObjC/setter-dotsyntax.m +++ b/clang/test/SemaObjC/setter-dotsyntax.m @@ -12,7 +12,7 @@ @interface MyClass : NSObject @end -int main () +int main (void) { id c; c.level = 10; diff --git a/clang/test/SemaObjC/sign-conversion.m b/clang/test/SemaObjC/sign-conversion.m index 584ea19..a340c15 100644 --- a/clang/test/SemaObjC/sign-conversion.m +++ b/clang/test/SemaObjC/sign-conversion.m @@ -20,7 +20,7 @@ typedef unsigned int NSUInteger; @end -void foo() { +void foo(void) { X *x = [X new]; signed int sint = -1; [x setUint:sint]; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}} @@ -28,7 +28,7 @@ void foo() { } // rdar://13855682 -void Test1() { +void Test1(void) { signed int si = -1; NSArray *array; diff --git a/clang/test/SemaObjC/signed-char-bool-conversion.m b/clang/test/SemaObjC/signed-char-bool-conversion.m index 9442d8f..4c32390 100644 --- a/clang/test/SemaObjC/signed-char-bool-conversion.m +++ b/clang/test/SemaObjC/signed-char-bool-conversion.m @@ -13,7 +13,7 @@ float fl; int i; int *ptr; -void t1() { +void t1(void) { b = boolean; b = fl; // expected-warning {{implicit conversion from floating-point type 'float' to 'BOOL'}} b = i; // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}} diff --git a/clang/test/SemaObjC/sizeof-interface.m b/clang/test/SemaObjC/sizeof-interface.m index db765b7..8325b16 100644 --- a/clang/test/SemaObjC/sizeof-interface.m +++ b/clang/test/SemaObjC/sizeof-interface.m @@ -80,7 +80,7 @@ int bar(I0 *P) { @interface Foo @end -int foo() +int foo(void) { Foo *f; diff --git a/clang/test/SemaObjC/special-dep-unavail-warning.m b/clang/test/SemaObjC/special-dep-unavail-warning.m index b667c3c..fdf907e 100644 --- a/clang/test/SemaObjC/special-dep-unavail-warning.m +++ b/clang/test/SemaObjC/special-dep-unavail-warning.m @@ -49,7 +49,7 @@ __attribute ((deprecated)) // expected-note {{'DEPRECATED' has been explicitly m +(id)new; @end -void foo() { +void foo(void) { [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}} } diff --git a/clang/test/SemaObjC/static-ivar-ref-1.m b/clang/test/SemaObjC/static-ivar-ref-1.m index d9f99f5..ff48d93 100644 --- a/clang/test/SemaObjC/static-ivar-ref-1.m +++ b/clang/test/SemaObjC/static-ivar-ref-1.m @@ -12,7 +12,7 @@ current *pc; -int foo() +int foo(void) { return pc->ivar2 + (*pc).ivar + pc->ivar1; } diff --git a/clang/test/SemaObjC/super-property-notation.m b/clang/test/SemaObjC/super-property-notation.m index 7d7b84d..17a7e81 100644 --- a/clang/test/SemaObjC/super-property-notation.m +++ b/clang/test/SemaObjC/super-property-notation.m @@ -22,7 +22,7 @@ } @end -void f0() { +void f0(void) { // FIXME: not implemented yet. //int l1 = A.classGetter; int l2 = [A classGetter2]; diff --git a/clang/test/SemaObjC/super.m b/clang/test/SemaObjC/super.m index fd069af..84a7038 100644 --- a/clang/test/SemaObjC/super.m +++ b/clang/test/SemaObjC/super.m @@ -62,7 +62,7 @@ typedef Foo super; typedef Foo FooTD; -void test() { +void test(void) { [FooTD cMethod]; [super cMethod]; } @@ -71,12 +71,12 @@ struct SomeStruct { int X; }; -int test2() { +int test2(void) { struct SomeStruct super = { 0 }; return super.X; } -int test3() { +int test3(void) { id super = 0; [(B*)super instanceMethod]; int *s1 = (int*)super; diff --git a/clang/test/SemaObjC/synchronized.m b/clang/test/SemaObjC/synchronized.m index c158815..21ffc32 100644 --- a/clang/test/SemaObjC/synchronized.m +++ b/clang/test/SemaObjC/synchronized.m @@ -14,7 +14,7 @@ struct x { int a; } b; -void test1() { +void test1(void) { @synchronized (b) { // expected-error {{@synchronized requires an Objective-C object type ('struct x' invalid)}} } diff --git a/clang/test/SemaObjC/synth-provisional-ivars-1.m b/clang/test/SemaObjC/synth-provisional-ivars-1.m index 39f4747..3dddaa6 100644 --- a/clang/test/SemaObjC/synth-provisional-ivars-1.m +++ b/clang/test/SemaObjC/synth-provisional-ivars-1.m @@ -11,7 +11,7 @@ typedef unsigned char BOOL; @property(assign) BOOL isAppleInternal; @end -static BOOL isAppleInternal() {return 0; } +static BOOL isAppleInternal(void) {return 0; } @implementation MailApp diff --git a/clang/test/SemaObjC/transfer-boxed-string-nullability.m b/clang/test/SemaObjC/transfer-boxed-string-nullability.m index a3b6832..71ee2f4 100644 --- a/clang/test/SemaObjC/transfer-boxed-string-nullability.m +++ b/clang/test/SemaObjC/transfer-boxed-string-nullability.m @@ -15,7 +15,7 @@ void takesNonNull(NSString * _Nonnull ptr); -void testBoxedString() { +void testBoxedString(void) { // No diagnostic emitted as this doesn't need a stringWithUTF8String message // send. takesNonNull(@("hey")); diff --git a/clang/test/SemaObjC/try-catch.m b/clang/test/SemaObjC/try-catch.m index 04d4ff8..0bea7a5 100644 --- a/clang/test/SemaObjC/try-catch.m +++ b/clang/test/SemaObjC/try-catch.m @@ -42,7 +42,7 @@ typedef struct _NSZone NSZone; } // FIXME: This should warn about a missing return too. @end -int foo() { +int foo(void) { struct s { int a, b; } agg, *pagg; @throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}} diff --git a/clang/test/SemaObjC/ucn-objc-string.m b/clang/test/SemaObjC/ucn-objc-string.m index f80d1ff..b0a51ef 100644 --- a/clang/test/SemaObjC/ucn-objc-string.m +++ b/clang/test/SemaObjC/ucn-objc-string.m @@ -3,7 +3,7 @@ @class NSString; extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); -int main() { +int main(void) { NSLog(@"Hi…"); NSLog(@"Exposé"); NSLog(@"\U00010400\U0001D12B"); diff --git a/clang/test/SemaObjC/unguarded-availability-maccatalyst.m b/clang/test/SemaObjC/unguarded-availability-maccatalyst.m index 9d05a2b..8d17df1 100644 --- a/clang/test/SemaObjC/unguarded-availability-maccatalyst.m +++ b/clang/test/SemaObjC/unguarded-availability-maccatalyst.m @@ -11,9 +11,9 @@ #define AVAILABLE_CURRENT __attribute__((availability(macCatalyst, introduced = 14))) #define AVAILABLE_NEXT __attribute__((availability(macCatalyst, introduced = 14.1))) -void previouslyAvailable() AVAILABLE_PREV; -void currentlyAvailable() AVAILABLE_CURRENT; -void willBeAvailabile() AVAILABLE_NEXT; +void previouslyAvailable(void) AVAILABLE_PREV; +void currentlyAvailable(void) AVAILABLE_CURRENT; +void willBeAvailabile(void) AVAILABLE_NEXT; #ifndef NO_WARNING // expected-note@-2 {{'willBeAvailabile' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}} #endif @@ -36,7 +36,7 @@ Record var; AVAILABLE_NEXT Record var2; -void test() { +void test(void) { previouslyAvailable(); currentlyAvailable(); willBeAvailabile(); @@ -52,14 +52,14 @@ void test() { willBeAvailabile(); // OK } -void previouslyAvailableIOS() __attribute__((availability(ios, introduced = 10))); -void currentlyAvailableIOS() __attribute__((availability(ios, introduced = 14))); -void willBeAvailabileIOS() __attribute__((availability(ios, introduced = 14.1))); +void previouslyAvailableIOS(void) __attribute__((availability(ios, introduced = 10))); +void currentlyAvailableIOS(void) __attribute__((availability(ios, introduced = 14))); +void willBeAvailabileIOS(void) __attribute__((availability(ios, introduced = 14.1))); #ifndef NO_WARNING // expected-note@-2 {{'willBeAvailabileIOS' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}} #endif -void testIOSAvailabilityAlsoWorks() { +void testIOSAvailabilityAlsoWorks(void) { previouslyAvailableIOS(); currentlyAvailableIOS(); willBeAvailabileIOS(); diff --git a/clang/test/SemaObjC/unguarded-availability-new.m b/clang/test/SemaObjC/unguarded-availability-new.m index ed61bf9..eba25a6 100644 --- a/clang/test/SemaObjC/unguarded-availability-new.m +++ b/clang/test/SemaObjC/unguarded-availability-new.m @@ -66,15 +66,15 @@ #define AVAILABLE_NEXT __attribute__((availability(watchos, introduced = 5))) #endif -void previouslyAvailable() AVAILABLE_PREV; +void previouslyAvailable(void) AVAILABLE_PREV; #ifdef WARN_PREV // expected-note@-2 {{'previouslyAvailable' has been marked as being introduced}} #endif -void currentlyAvailable() AVAILABLE_CURRENT; +void currentlyAvailable(void) AVAILABLE_CURRENT; #ifdef WARN_CURRENT // expected-note@-2 {{'currentlyAvailable' has been marked as being introduced}} #endif -void willBeAvailabile() AVAILABLE_NEXT; +void willBeAvailabile(void) AVAILABLE_NEXT; #ifndef NO_WARNING // expected-note@-2 {{'willBeAvailabile' has been marked as being introduced in}} #endif @@ -109,7 +109,7 @@ FUNC_AVAILABLE new_int x; #endif #endif -void test() FUNC_AVAILABLE { +void test(void) FUNC_AVAILABLE { previouslyAvailable(); #ifdef WARN_PREV #ifdef MAC diff --git a/clang/test/SemaObjC/unguarded-availability.m b/clang/test/SemaObjC/unguarded-availability.m index dffad1d..ad94eb7 100644 --- a/clang/test/SemaObjC/unguarded-availability.m +++ b/clang/test/SemaObjC/unguarded-availability.m @@ -7,16 +7,16 @@ typedef int AVAILABLE_10_12 new_int; // expected-note + {{'new_int' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} -int func_10_11() AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}} +int func_10_11(void) AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}} #ifdef OBJCPP // expected-note@+2 6 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} #endif -int func_10_12() AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} +int func_10_12(void) AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} -int func_10_0() AVAILABLE_10_0; +int func_10_0(void) AVAILABLE_10_0; -void use_func() { +void use_func(void) { func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}} if (@available(macos 10.11, *)) @@ -25,13 +25,13 @@ void use_func() { func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}} } -void defn_10_11() AVAILABLE_10_11; +void defn_10_11(void) AVAILABLE_10_11; -void defn_10_11() { +void defn_10_11(void) { func_10_11(); } -void nested_ifs() { +void nested_ifs(void) { if (@available(macos 10.12, *)) { if (@available(macos 10.10, *)) { func_10_12(); @@ -43,7 +43,7 @@ void nested_ifs() { } } -void star_case() { +void star_case(void) { if (@available(ios 9, *)) { func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}} func_10_0(); @@ -67,7 +67,7 @@ typedef int int_10_11 AVAILABLE_10_11; // expected-note {{'int_10_11' has been m #endif typedef int int_10_12 AVAILABLE_10_12; // expected-note 2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} -void use_typedef() { +void use_typedef(void) { int_10_11 x; // expected-warning{{'int_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'int_10_11' in an @available check to silence this warning}} } @@ -92,7 +92,7 @@ AVAILABLE_10_11 @interface Class_10_11 { // expected-note{{annotate 'Class_10_11 @end -int protected_scope() { +int protected_scope(void) { if (@available(macos 10.20, *)) { // expected-note 2 {{jump enters controlled statement of if available}} label1: return 0; @@ -113,7 +113,7 @@ struct S { } n; }; -int test_members() { +int test_members(void) { struct S s; (void)s.m1; (void)s.m2; // expected-warning{{'m2' is only available on macOS 10.12 or newer}} expected-note{{@available}} @@ -121,7 +121,7 @@ int test_members() { (void)s.n.nested_member; // expected-warning{{'nested_member' is only available on macOS 10.12 or newer}} expected-note{{@available}} } -void test_blocks() { +void test_blocks(void) { (void) ^{ func_10_12(); // expected-warning{{'func_10_12' is only available on macOS 10.12 or newer}} expected-note{{@available}} }; @@ -139,7 +139,7 @@ void test_params(int_10_12 x); // expected-warning {{'int_10_12' is only availab void test_params2(int_10_12 x) AVAILABLE_10_12; // no warn -void (^topLevelBlockDecl)() = ^ { +void (^topLevelBlockDecl)(void) = ^ { func_10_12(); // expected-warning{{'func_10_12' is only available on macOS 10.12 or newer}} expected-note{{@available}} if (@available(macos 10.12, *)) func_10_12(); @@ -165,13 +165,13 @@ void test_at(Subscriptable *x) { id y = x[42]; // expected-warning{{'objectAtIndexedSubscript:' is only available on macOS 10.12 or newer}} expected-note{{@available}} } -void uncheckAtAvailable() { +void uncheckAtAvailable(void) { if (@available(macOS 10.12, *) || 0) // expected-warning {{@available does not guard availability here; use if (@available) instead}} func_10_12(); // expected-warning {{'func_10_12' is only available on macOS 10.12 or newer}} // expected-note@-1 {{enclose 'func_10_12' in an @available check to silence this warning}} } -void justAtAvailable() { +void justAtAvailable(void) { int availability = @available(macOS 10.12, *); // expected-warning {{@available does not guard availability here; use if (@available) instead}} } @@ -296,7 +296,7 @@ typedef enum { // expected-note{{annotate anonymous enum with an availability at @property (class) new_int x; // expected-warning{{'new_int' is only available}} @end -void with_local_struct() { +void with_local_struct(void) { struct local { new_int x; // expected-warning{{'new_int' is only available}} expected-note{{enclose 'new_int' in an @available check}} }; @@ -384,15 +384,15 @@ AVAILABLE_10_11 @end __attribute__((constructor)) -void is_constructor(); +void is_constructor(void); AVAILABLE_10_11 // expected-warning{{ignoring availability attribute with constructor attribute}} -void is_constructor() { +void is_constructor(void) { func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}} } AVAILABLE_10_11 // expected-warning{{ignoring availability attribute with destructor attribute}} __attribute__((destructor)) -void is_destructor() { +void is_destructor(void) { func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}} } diff --git a/clang/test/SemaObjC/uninit-variables.m b/clang/test/SemaObjC/uninit-variables.m index a331226..34bc337 100644 --- a/clang/test/SemaObjC/uninit-variables.m +++ b/clang/test/SemaObjC/uninit-variables.m @@ -13,13 +13,13 @@ // Duplicated from uninit-variables.c. // Test just to ensure the analysis is working. -int test1() { +int test1(void) { int x; // expected-note{{initialize the variable 'x' to silence this warning}} return x; // expected-warning{{variable 'x' is uninitialized when used here}} } // Test ObjC fast enumeration. -void test2() { +void test2(void) { id collection = 0; for (id obj in collection) { if (0 == obj) // no-warning @@ -27,7 +27,7 @@ void test2() { } } -void test3() { +void test3(void) { id collection = 0; id obj; for (obj in collection) { // no-warning diff --git a/clang/test/SemaObjC/unknown-anytype.m b/clang/test/SemaObjC/unknown-anytype.m index 38e058c..62ee4cf 100644 --- a/clang/test/SemaObjC/unknown-anytype.m +++ b/clang/test/SemaObjC/unknown-anytype.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -verify %s extern __unknown_anytype test0; -extern __unknown_anytype test1(); +extern __unknown_anytype test1(void); @interface A - (int*)getIntPtr; @@ -13,7 +13,7 @@ extern __unknown_anytype test1(); - (short*)getSomePtr; @end -void test_unknown_anytype_receiver() { +void test_unknown_anytype_receiver(void) { int *ip = [test0 getIntPtr]; float *fp = [test1() getFloatPtr]; double *dp = [test1() getSomePtr]; // okay: picks first method found diff --git a/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m b/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m index e6fa138..7dda02d 100644 --- a/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m +++ b/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m @@ -22,7 +22,7 @@ void functionTakingAClassConformingToAProtocol(AClass *instance) { // expected-note {{passing argument to parameter 'instance' here}} } -int main () { +int main (void) { AClass *aobject = 0; BClass *bobject = 0; functionTakingAClassConformingToAProtocol(aobject); // expected-warning {{incompatible pointer types passing 'AClass *' to parameter of type 'AClass *'}} diff --git a/clang/test/SemaObjC/unused.m b/clang/test/SemaObjC/unused.m index 088f5b4..16f1e40 100644 --- a/clang/test/SemaObjC/unused.m +++ b/clang/test/SemaObjC/unused.m @@ -20,7 +20,7 @@ int test1(void) { - (int)length; @end -void test2() { +void test2(void) { @"pointless example call for test purposes".length; // expected-warning {{property access result unused - getters should not be used for side effects}} } diff --git a/clang/test/SemaObjC/warn-cast-of-sel-expr.m b/clang/test/SemaObjC/warn-cast-of-sel-expr.m index 1253db9..a8fa32e 100644 --- a/clang/test/SemaObjC/warn-cast-of-sel-expr.m +++ b/clang/test/SemaObjC/warn-cast-of-sel-expr.m @@ -6,7 +6,7 @@ SEL s; SEL sel_registerName(const char *); -int main() { +int main(void) { (char *)s; // expected-warning {{cast of type 'SEL' to 'char *' is deprecated; use sel_getName instead}} (void *)s; // ok (const char *)sel_registerName("foo"); // expected-warning {{cast of type 'SEL' to 'const char *' is deprecated; use sel_getName instead}} diff --git a/clang/test/SemaObjC/warn-direct-ivar-access.m b/clang/test/SemaObjC/warn-direct-ivar-access.m index 946e516..f953072 100644 --- a/clang/test/SemaObjC/warn-direct-ivar-access.m +++ b/clang/test/SemaObjC/warn-direct-ivar-access.m @@ -30,7 +30,7 @@ __attribute__((objc_root_class)) @interface MyObject { - (void) dealloc { _myLeader = 0; } @end -MyObject * foo () +MyObject * foo (void) { MyObject* p=0; p.isTickledPink = p.myLeader; // ok diff --git a/clang/test/SemaObjC/warn-incompatible-builtin-types.m b/clang/test/SemaObjC/warn-incompatible-builtin-types.m index fd4fb7d..6326ab8 100644 --- a/clang/test/SemaObjC/warn-incompatible-builtin-types.m +++ b/clang/test/SemaObjC/warn-incompatible-builtin-types.m @@ -5,7 +5,7 @@ - (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}} @end -void FUNC() { +void FUNC(void) { Class c, c1; SEL s1, s2; id i, i1; diff --git a/clang/test/SemaObjC/warn-loop-analysis.m b/clang/test/SemaObjC/warn-loop-analysis.m index 8ae7375..6818024 100644 --- a/clang/test/SemaObjC/warn-loop-analysis.m +++ b/clang/test/SemaObjC/warn-loop-analysis.m @@ -7,7 +7,7 @@ // Do not warn on objc classes has objectAtIndexedSubscript method. MyArray *test; -void foo() +void foo(void) { unsigned int i; for (i = 42; i > 0;) // No warnings here diff --git a/clang/test/SemaObjC/warn-retain-block-property.m b/clang/test/SemaObjC/warn-retain-block-property.m index 84cdd9f..981e1bd 100644 --- a/clang/test/SemaObjC/warn-retain-block-property.m +++ b/clang/test/SemaObjC/warn-retain-block-property.m @@ -4,7 +4,7 @@ // RUN: not %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class %s 2>&1 | FileCheck %s // rdar://11761511 -extern void doSomething(); +extern void doSomething(void); @interface Test { @@ -24,7 +24,7 @@ extern void doSomething(); @dynamic aBlockW, aBlockS, aBlockR, aBlockC, aBlockA; @end -int main() { +int main(void) { Test *t; t.aBlock = ^{ doSomething(); }; t.aBlockW = ^{ doSomething(); }; diff --git a/clang/test/SemaObjC/warn-retain-cycle.m b/clang/test/SemaObjC/warn-retain-cycle.m index eadd227..88cf2c2 100644 --- a/clang/test/SemaObjC/warn-retain-cycle.m +++ b/clang/test/SemaObjC/warn-retain-cycle.m @@ -130,7 +130,7 @@ void doSomething(unsigned v); @end -void testBlockVariable() { +void testBlockVariable(void) { typedef void (^block_t)(void); // This case will be caught by -Wuninitialized, and does not create a diff --git a/clang/test/SemaObjC/warn-strict-selector-match.m b/clang/test/SemaObjC/warn-strict-selector-match.m index 6b92cb8..85f1868 100644 --- a/clang/test/SemaObjC/warn-strict-selector-match.m +++ b/clang/test/SemaObjC/warn-strict-selector-match.m @@ -8,7 +8,7 @@ -(float) method; // expected-note {{also found}} @end -int main() { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found}} +int main(void) { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found}} @interface Object @end diff --git a/clang/test/SemaObjC/warn-unreachable.m b/clang/test/SemaObjC/warn-unreachable.m index 3667676..253d443 100644 --- a/clang/test/SemaObjC/warn-unreachable.m +++ b/clang/test/SemaObjC/warn-unreachable.m @@ -3,14 +3,14 @@ // This previously triggered a warning from -Wunreachable-code because of // a busted CFG. typedef signed char BOOL; -BOOL radar10989084() { +BOOL radar10989084(void) { @autoreleasepool { // no-warning return __objc_yes; } } // Test the warning works. -void test_unreachable() { +void test_unreachable(void) { return; return; // expected-warning {{will never be executed}} } @@ -20,21 +20,21 @@ void test_unreachable() { #define CONFIG NO // Test that 'NO' and 'YES' are not treated as configuration macros. -int test_NO() { +int test_NO(void) { if (NO) return 1; // expected-warning {{will never be executed}} else return 0; } -int test_YES() { +int test_YES(void) { if (YES) return 1; else return 0; // expected-warning {{will never be executed}} } -int test_CONFIG() { +int test_CONFIG(void) { if (CONFIG) return 1; else @@ -49,7 +49,7 @@ void test_loop_increment(id container) { } } -void calledFun() {} +void calledFun(void) {} // Test "silencing" with parentheses. void test_with_paren_silencing(int x) { diff --git a/clang/test/SemaObjC/warn-unused-exception-param.m b/clang/test/SemaObjC/warn-unused-exception-param.m index 221e16f..968a6e0 100644 --- a/clang/test/SemaObjC/warn-unused-exception-param.m +++ b/clang/test/SemaObjC/warn-unused-exception-param.m @@ -1,4 +1,4 @@ // RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions -Wunused-exception-parameter %s -void f0() { +void f0(void) { @try {} @catch(id a) {} // expected-warning{{unused exception parameter 'a'}} } diff --git a/clang/test/SemaObjC/warn-weak-field.m b/clang/test/SemaObjC/warn-weak-field.m index e7b0fe2..856bf17f 100644 --- a/clang/test/SemaObjC/warn-weak-field.m +++ b/clang/test/SemaObjC/warn-weak-field.m @@ -17,7 +17,7 @@ struct S { - (void) foo { w = 0; LHS = w; } @end -int main () +int main (void) { struct I { __weak id w1; // expected-warning {{__weak attribute cannot be specified on a field declaration}} -- 2.7.4