Tag: freebsd

stdarg.h在哪里?

在我的系统上(Mac OS 10.6) /usr/include/stdarg.h是: /* This file is public domain. */ /* GCC uses its own copy of this header */ #if defined(__GNUC__) #include_next #elif defined(__MWERKS__) #include “mw_stdarg.h” #else #error “This header only supports __MWERKS__.” #endif 那么,如果GCC使用自己的stdarg.h副本,它在哪里呢? 我不知道#include_next意味着什么(可能是GCC扩展?),也不知道“MWERKS”(编译器?)。

如何从内联asm访问C结构/变量?

请考虑以下代码: int bn_div(bn_t *bn1, bn_t *bn2, bn_t *bnr) { uint32 q, m; /* Division Result */ uint32 i; /* Loop Counter */ uint32 j; /* Loop Counter */ /* Check Input */ if (bn1 == NULL) return(EFAULT); if (bn1->dat == NULL) return(EFAULT); if (bn2 == NULL) return(EFAULT); if (bn2->dat == NULL) return(EFAULT); if (bnr == […]

定义中函数标题后的C变量声明

在阅读一些FreeBSD源代码时(参见: radix.h第158-173行),我发现了定义中“函数标题”之后的变量声明。 这在ISO C(C99)中有效吗? 什么时候应该在生产代码中完成而不是仅仅在“函数标题”中声明变量? 为什么要在这里完成? 我指的是标题字符串的函数,如下所示: int someFunction(int i, int b) {