我的任务是为C 程序开发源代码分析工具,我需要在分析之前对代码进行预处理。我想知道什么是最好的图书馆。我需要轻巧便携的东西。
最佳答案
与其自己推出,不如使用 gcc
套件中的 cpp
:http://gcc.gnu.org/onlinedocs/gcc-4.6.1/cpp/
CPP(1) GNU CPP(1)
NAME
cpp - The C Preprocessor
SYNOPSIS
cpp [-Dmacro[=defn]...] [-Umacro]
[-Idir...] [-iquotedir...]
[-Wwarn...]
[-M|-MM] [-MG] [-MF filename]
[-MP] [-MQ target...]
[-MT target...]
[-P] [-fno-working-directory]
[-x language] [-std=standard]
infile outfile
Only the most useful options are listed here; see below for the
remainder.
DESCRIPTION
The C preprocessor, often known as cpp, is a macro processor that is
used automatically by the C compiler to transform your program before
compilation. It is called a macro processor because it allows you to
define macros, which are brief abbreviations for longer constructs.
关于C 预处理器库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6835699/