quakeforge/tools/qfcc/test/dealloc-warn.r
Bill Currie e4bb5c8048 [qfcc] Add pragma to control warning promotion
This allows me to disable -Werror in the Makefile but still have the
build tests work properly and not fail when they shouldn't.
2022-01-25 22:15:28 +09:00

37 lines
717 B
R

#pragma warn error
@interface Object
{
Class isa;
}
-(void)dealloc;
@end
@interface derived : Object
@end
@implementation Object
-(void) dealloc
{
// this is the root of the hierarchy, so no super to call, thus
// must not check for [super dealloc]
}
@end
@implementation derived
-(void) dealloc
{
// as this is a derived class, failure to call [super dealloc] will
// result in a memory leak (yes, there could be special allocators
// involved, in which case something will be needed to inform the
// compiler)
}
@end
void __obj_exec_class (struct obj_module *msg) = #0;
id obj_msgSend_super (Super *class, SEL op, ...) = #0;
int main ()
{
return 1; // test fails if compile succeeds (with -Werror)
}