File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1- // RUN: %clang_cc1 -fsyntax-only -verify -Walloc-size %s
1+ // RUN: %clang_cc1 -triple x86_64-linux - fsyntax-only -verify -Walloc-size %s
22struct Foo { int x [10 ]; };
33
44struct ZeroSize {
@@ -42,7 +42,7 @@ void alloc_foo(void) {
4242 // expected-warning@-1 {{allocation of insufficient size '1' for type 'int' with size '4'}}
4343 (void )(int * )my_malloc (1 ); // expected-warning {{allocation of insufficient size '1' for type 'int' with size '4'}}
4444
45- struct ZeroSize * ptr18 = my_malloc (0 ); // okay becuase sizeof(struct ZeroSize) = 0
45+ struct ZeroSize * ptr18 = my_malloc (0 ); // okay because sizeof(struct ZeroSize) = 0
4646
4747 void * funcptr_1 = (void (* )(int ))my_malloc (0 ); // expected-warning {{allocation of insufficient size '0' for type 'void (int)' with size '1'}}
4848 void * funcptr_2 = (void (* )(int ))my_malloc (1 );
You can’t perform that action at this time.
0 commit comments