Skip to content

Commit 1b65723

Browse files
mulle-natCopilot
andcommitted
Add #pragma clang diagnostic ignored "-Wobjc-root-class" to test files
Suppress -Wobjc-root-class warnings in test files that intentionally define root classes. Files with a corresponding .ccdiag file (where the warning is intentionally tested) are left untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3837bd4 commit 1b65723

File tree

386 files changed

+7403
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

386 files changed

+7403
-17
lines changed

src/mulle-objc-builtin.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ static inline void
200200
if( ! self)
201201
return;
202202

203+
// proetection against wrap-around to root meta, which then clobbers
204+
// the runtime struct !
205+
assert( _mulle_objc_class_is_infraclass( _mulle_objc_object_get_isa( self)));
206+
203207
if( strategy & mulle_objc_property_accessor_copy)
204208
{
205209
if( strategy & mulle_objc_property_accessor_mutable_copy) // da apple way
@@ -240,9 +244,15 @@ void *
240244

241245
MULLE_C_UNUSED( _cmd);
242246

247+
// TODO: check if these self checks arent super superflous in terms of
248+
// compiler emission )
243249
if( ! self)
244250
return( NULL);
245251

252+
// protection against wrap-around to root meta, which then clobbers
253+
// the runtime struct !
254+
assert( _mulle_objc_class_is_infraclass( _mulle_objc_object_get_isa( self)));
255+
246256
p_ivar = (void **) &((char *) self)[ offset];
247257
if( strategy & mulle_objc_property_accessor_atomic)
248258
{
@@ -271,6 +281,15 @@ static inline void mulle_objc_object_add_to_container( void *self,
271281
{
272282
void **p_ivar;
273283

284+
// TODO: check if these self checks arent super superflous in terms of
285+
// compiler emission )
286+
if( ! self)
287+
return;
288+
289+
// protection against wrap-around to root meta, which then clobbers
290+
// the runtime struct !
291+
assert( _mulle_objc_class_is_infraclass( _mulle_objc_object_get_isa( self)));
292+
274293
p_ivar = (void **) &((char *) self)[ offset];
275294

276295
assert_same_mulle_allocator( self, value);
@@ -284,6 +303,15 @@ static inline void mulle_objc_object_remove_from_container( void *self,
284303
{
285304
void **p_ivar;
286305

306+
// TODO: check if these self checks arent super superflous in terms of
307+
// compiler emission )
308+
if( ! self)
309+
return;
310+
311+
// protection against wrap-around to root meta, which then clobbers
312+
// the runtime struct !
313+
assert( _mulle_objc_class_is_infraclass( _mulle_objc_object_get_isa( self)));
314+
287315
p_ivar = (void **) &((char *) self)[ offset];
288316
mulle_objc_object_call_removeobject( *p_ivar, value);
289317
}
@@ -300,6 +328,15 @@ static inline void mulle_objc_object_will_read_relationship( void *self,
300328
{
301329
void **p_ivar;
302330

331+
// TODO: check if these self checks arent super superflous in terms of
332+
// compiler emission )
333+
if( ! self)
334+
return;
335+
336+
// protection against wrap-around to root meta, which then clobbers
337+
// the runtime struct !
338+
assert( _mulle_objc_class_is_infraclass( _mulle_objc_object_get_isa( self)));
339+
303340
p_ivar = (void **) &((char *) self)[ offset];
304341
*p_ivar = mulle_objc_object_call_willreadrelationship( self, *p_ivar);
305342
}

src/mulle-objc-universe-struct.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,13 @@ struct _mulle_objc_universedebug
155155

156156
struct
157157
{
158-
unsigned protocolclass : 1;
159-
unsigned stuck_loadable : 1; // set by default
160-
unsigned method_type : 2;
161-
unsigned method_bits : 1;
162-
unsigned crash : 1;
163-
unsigned hang : 1;
158+
unsigned protocolclass : 1;
159+
unsigned stuck_loadable : 1; // set by default
160+
unsigned method_type : 2;
161+
unsigned method_bits : 1;
162+
unsigned crash : 1;
163+
unsigned hang : 1;
164+
unsigned load_category_dependency : 1;
164165
} warn;
165166

166167
struct

src/mulle-objc-universe.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,11 @@ static void _mulle_objc_universe_get_environment( struct _mulle_objc_universe
353353

354354
if( getenv_yes_no( "MULLE_OBJC_WARN_ENABLED"))
355355
{
356-
universe->debug.warn.protocolclass = 1;
357-
universe->debug.warn.stuck_loadable = 1;
358-
universe->debug.warn.method_bits = 1;
359-
universe->debug.warn.method_type = MULLE_OBJC_WARN_METHOD_TYPE_NORMAL;
356+
universe->debug.warn.protocolclass = 1;
357+
universe->debug.warn.stuck_loadable = 1;
358+
universe->debug.warn.method_bits = 1;
359+
universe->debug.warn.method_type = MULLE_OBJC_WARN_METHOD_TYPE_NORMAL;
360+
universe->debug.warn.load_category_dependency = 1;
360361
}
361362
else
362363
{
@@ -1801,9 +1802,19 @@ static int
18011802
for( ; method < sentinel; method++)
18021803
{
18031804
// skip +dependencies itself, it's expected to be overridden
1804-
if( method->descriptor.methodid == MULLE_OBJC_DEPENDENCIES_METHODID)
1805+
switch( method->descriptor.methodid)
1806+
{
1807+
case MULLE_OBJC_DEPENDENCIES_METHODID :
18051808
continue;
18061809

1810+
// do these can make sense to check but not by default
1811+
case MULLE_OBJC_LOAD_METHODID :
1812+
case MULLE_OBJC_UNLOAD_METHODID :
1813+
if( ! universe->debug.warn.load_category_dependency)
1814+
continue;
1815+
}
1816+
1817+
18071818
stored = _mulle__pointermap_get( map,
18081819
(void *) (uintptr_t) method->descriptor.methodid);
18091820
if( ! stored)

test-calli/calli/calli.O0-f1.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

test-calli/calli/calli.O0-f2.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

test-calli/calli/calli.O0-f3.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

test-calli/calli/calli.O0-f4.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

test-calli/calli/calli.O0-f5.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

test-calli/calli/calli.O0.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

test-calli/calli/calli.O1-f1.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <mulle-core/mulle-core.h>
77

8+
#pragma clang diagnostic ignored "-Wobjc-root-class"
9+
810
@interface NoWarn
911
- (void) call:(char *) s;
1012
@end

0 commit comments

Comments
 (0)