kext8.c
来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 37 行
C
37 行
/* APPLE LOCAL file KEXT double destructor --bowdidge *//* Radar 3943783 kernel extensions built with gcc-4.0 can't be loaded *//* { dg-do compile { target powerpc*-apple-darwin* } } *//* { dg-options "-S -fapple-kext -fno-exceptions" } *//* Here's some kext class hierarchy code. */struct Base { virtual ~Base();} __attribute__((apple_kext_compatibility));struct Derived : Base { void operator delete(void *) { } Derived();};void foo() { Derived d1; // ok}/* Here's some inlined functions to try to trick the compiler into creating coalesced sections. */inline unsigned f(unsigned n) { return n == 0 ? 0 : n + f(n-1); }unsigned g(unsigned n) { return f(n); }/* Here's some template stuff to try to trick the compiler into creating coalesced sections another way. */ template <typename X> X ident(X x) { return x; } int foo(int n) { return ident(n); }/* See if there's any sections with the coalesced flag. coalesced sections currently aren't loaded by the kernel loader into memory. *//* { dg-final { scan-assembler-not "coalesced" } } */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?