Macros 如何在Sun Studio下打印预处理器宏?

Macros 如何在Sun Studio下打印预处理器宏?,macros,c-preprocessor,solaris,sunstudio,Macros,C Preprocessor,Solaris,Sunstudio,我在SunOS5.11(Solaris 11.3)上的Sun Studio 12.3下工作。我需要查看Sun Studio定义的宏,以修复套件下的错误报告。这类似于,但引用的问题使用GCC及其预处理器;而不是Sun Studio的预处理器 我已经运行了CC-flags,但我没有看到类似于GCC的cpp-dM或g++-dM-E-的选项是可变参数。 条|表示文字值的选择。 ________________________________________________________________

我在SunOS5.11(Solaris 11.3)上的Sun Studio 12.3下工作。我需要查看Sun Studio定义的宏,以修复套件下的错误报告。这类似于,但引用的问题使用GCC及其预处理器;而不是Sun Studio的预处理器

我已经运行了
CC-flags
,但我没有看到类似于GCC的
cpp-dM
g++-dM-E-的选项是可变参数。
条|表示文字值的选择。
______________________________________________________________________________
-#详细模式
-###显示由驱动程序生成的编译器命令,无编译
-B[static | dynamic]指定动态或静态绑定
-D将名称与标记关联,如同#定义
-E仅通过预处理器编译源代码,输出到标准输出
-G构建动态共享库
-H在编译过程中包含的每个文件的打印路径名
-我添加到预处理器#包含文件搜索路径
-具有32位地址的KPIC编译位置独立代码
-Kpic编译位置独立代码
-L传递到链接器以添加到库搜索路径
-M将映射文件传递到链接器
-O使用默认优化级别(-xO3)
-O与-xO相同
-P仅通过预处理器编译源代码,输出到.i文件
-PIC与KPIC相同
-Qoption[,…]将选项列表传递到编译阶段
-R将运行时搜索路径列表构建到可执行文件中
-S编译并仅生成程序集代码(.S)
-U删除预处理器符号的初始定义
-五、各编制阶段报告版本号
-W、 传递到指定组件(a、d、h、i、l、m、p、u、0,2)
-Xlinker传递到链接器
XM支持C++标识符中的美元字符
-Y、 指定组件的位置(a、l、m、p、0、h、i、u)
-是,更改搜索组件的默认目录
-YI,更改搜索包含文件的默认目录
-YP,更改查找库文件的默认目录
-YS,更改启动对象文件的默认目录
-c仅编译-生成.o文件,禁止链接
-compat=5标准模式;接受符合C++标准的默认代码(默认模式)
-compat=g++兼容模式;接受g++源代码并生成与g++兼容的目标代码
+d不要展开内联函数
-达利恩被忽略了
-链接器的d{n|y}动态[-dy]或静态[-dn]选项
-dryrun显示由驱动程序生成的编译器命令,无编译
-e传递给链接器
-erroff[=]抑制标记指定的警告={%none,%all,}
-errtags[={yes | no}]显示带有标记的消息
-errwarn[=]将标记指定的警告视为错误={%none,%all,}
-fPIC与-KPIC相同
-使用选择的选项快速优化
-特征= [,]启用/禁用各种C++语言特性
-filt[=[,]]控制链接器和编译器错误消息的过滤;
={错误、名称、返回、stdlib}
-标志显示编译器选项的此摘要
-flagsrc=接受文件中的命令选项
-fnonstd将浮点硬件初始化为非标准首选项
-fns[={yes | no}]选择非标准浮点模式
-fpic与-Kpic相同
-fprecision=设置FP舍入精度模式={单|双|扩展}
-fround=选择启动时有效的IEEE舍入模式
-fsimple[=]选择浮点优化首选项
-F存储力浮动pt。赋值时目标精度的值
-ftrap=选择启动时有效的浮点补漏白模式
-编译以进行调试
-g0编译以通过dbx进行调试,但允许内联
-g3编译以通过dbx进行调试,包括宏。
-h分配给生成的动态共享库
-帮助与-xhelp=flags相同
-我传递给链接器以忽略任何LD_LIBRARY_路径设置
-在其他文件之前包含的内容
-内联=尝试内联指定的用户例程={%auto,,no%}
-实例=控制模板实例化的链接属性;
={静态|全局|外部|显式|半显式}
-instlib=禁止生成已在中的实例
-keeptmp保留编译期间创建的临时文件
-l与lib.a或lib.so库链接
-libmieee与-xlibmieee相同
-libmil与-xlibmil相同
-library=[,]将指定的CC提供的库合并到编译和链接中
-m32设置32位寻址模式
-m64设置64位寻址模型
-mc从输出文件的.comment部分删除重复字符串
迁移显示从C++获取4.2迁移的信息。
-mr从输出的.comment部分删除所有字符串
$ echo $CXX
/opt/solarisstudio12.3/bin/CC
$ $CXX -E /dev/null
#1 "/dev/null"
$ $CXX -E test.cxx | grep __cplusplus
$
$ /opt/solarisstudio12.3/bin/CC -flags
______________________________________________________________________________
Items within [ ] are optional. Items within < > are variable parameters.
Bar | indicates choice of literal values.
______________________________________________________________________________
-#                            Verbose mode
-###                          Show compiler commands built by driver, no compilation
-B[static|dynamic]            Specify dynamic or static binding
-D<name[=token]>              Associate name with token as if by #define
-E                            Compile source through preprocessor only, output to stdout
-G                            Build a dynamic shared library
-H                            Print path name of each file included during compilation
-I<dir>                       Add <dir> to preprocessor #include file search path
-KPIC                         Compile position independent code with 32-bit addresses
-Kpic                         Compile position independent code
-L<dir>                       Pass to linker to add <dir> to the library search path
-M<file>                      Pass <file> mapfile to linker
-O                            Use default optimization level (-xO3)
-O<n>                         Same as -xO<n>
-P                            Compile source through preprocessor only, output to .i  file
-PIC                          Same as -KPIC
-Qoption <prog> <o>[,<o>...]  Pass options list <o> to compilation phase <prog>
-R<dir[:dir]>                 Build runtime search path list into executable
-S                            Compile and only generate assembly code (.s)
-U<name>                      Delete initial definition of preprocessor symbol <name>
-V                            Report version number of each compilation phase
-W<c>,<arg>                   Pass <arg> to specified component <c> (a,d,h,i,l,m,p,u,0,2) 
-Xlinker <arg>                Pass <arg> to linker
-Xm                           Support dollar character in C++ identifiers
-Y<c>,<dir>                   Specify <dir> for location of component <c> (a,l,m,p,0,h,i,u)
-YA,<dir>                     Change default directory searched for components
-YI,<dir>                     Change default directory searched for include files
-YP,<dir>                     Change default directory for finding libraries files
-YS,<dir>                     Change default directory for startup object files
-c                            Compile only - produce .o files, suppress linking
-compat=5                     Standard mode; accept source code that conforms to the C++ standard (default mode)
-compat=g                     G++ compatibility mode; accept g++ source code and generate g++ compatible object code
+d                            Do not expand inline functions
-dalign                       Ignored
-d{n|y}                       Dynamic [-dy] or static [-dn] option to linker
-dryrun                       Show compiler commands built by driver, no compilation
-e<arg>                       Passed to linker
-erroff[=<tags>]              Suppress warnings specified by tags; <tags>={%none, %all, <tag list>}
-errtags[={yes|no}]           Display messages with tags
-errwarn[=<tags>]             Treats warnings specified by tags as errors; <tags>={%none, %all, <tag list>}
-fPIC                         Same as -KPIC
-fast                         Optimize using a selection of options
-features=<a>[,<a>]           Enable/disable various C++ language features
-filt[=<a>[,<a>]]             Control the filtering of both linker and compiler error messages;
                              <a>={errors,names,returns,stdlib}
-flags                        Show this summary of compiler options
-flagsrc=<f>                  Accept command options from file <f>
-fnonstd                      Initialize floating-point hardware to non-standard preferences
-fns[={yes|no}]               Select non-standard floating point mode
-fpic                         Same as -Kpic
-fprecision=<a>               Set FP rounding precision mode; <a>={single|double|extended}
-fround=<r>                   Select the IEEE rounding mode in effect at startup
-fsimple[=<n>]                Select floating-point optimization preferences <n>
-fstore                       Force floating pt. values to target precision on assignment
-ftrap=<t>                    Select floating-point trapping mode in effect at startup
-g                            Compile for debugging
-g0                           Compile for debugging by dbx but allow inlining
-g3                           Compile for debugging by dbx including macros.
-h <name>                     Assign <name> to generated dynamic shared library
-help                         Same as -xhelp=flags
-i                            Passed to linker to ignore any LD_LIBRARY_PATH setting
-include <file>               Include the contents of <file> before other files
-inline=<v>                   Attempt inlining of specified user routines; <v>={%auto,<func>,no%<func>}
-instances=<a>                Control the link attributes of template instantiations;
                              <a>={static|global|extern|explicit|semiexplicit}
-instlib=<library>            Inhibit generation of instances already in <library>
-keeptmp                      Keep temporary files created during compilation
-l<name>                      Link with library lib<name>.a or lib<name>.so
-libmieee                     Same as -xlibmieee
-libmil                       Same as -xlibmil
-library=<a>[,<a>]            Incorporates specified CC-provided libraries into compilation and linking
-m32                          Set 32-bit addressing model
-m64                          Set 64-bit addressing model
-mc                           Remove duplicate strings from .comment section of output files
-migration                    Show where to get information about migrating from C++ 4.2
-mr                           Remove all strings from .comment section of output files
-mr,"string"                  Remove all strings and append "string" to .comment section
-mt[={yes|no}]                Specify options needed when compiling multi-threaded code
-native                       Optimize for the host system (-xtarget=native)
-noex                         Same as -features=no%except
-nofstore                     Do not force floating pt. values to target precision on assignment
-o <outputfile>               Set name of output file to <outputfile>
-p                            Compile for profiling with prof
+p                            Ignore non-standard preprocessor asserts
-pg                           Compile for profiling with gprof
-pic                          Same as -Kpic
-qp                           Compile for profiling with prof
-s                            Strip symbol table from the executable file
-shared                       Same as -G
-staticlib=<a>[,<a>]          Force linkage of specified libraries to be static
-sync_stdio[={yes|no}]        Controls synchronization of the I/O libraries
-temp=<path>                  Use <path> as directory for temporary files
-template=<a>[,<a>]           Enable/disable various template options;
                              <a>={wholeclass,extdef,geninlinefuncs}
-time                         Same as -xtime
-traceback[=<a>[,<a>]]        Provide stack traceback for the abnormal termination by signals; <a>={%none|common|<signal>}
-unroll=<n>                   Enable unrolling loops <n> times where possible
-v                            Same as -verbose=diags
-verbose=<a>[,<a>]            Control verbosity during compilation; <a>={template,diags,version}
-w                            Suppress compiler warning messages
+w                            Print warnings about additional questionable constructs
+w2                           Emit warnings for code with additional portability problems
-xF[=<a>[,<a>]]               Compile for later mapfile reordering and data fragmentation
-xM                           Generate makefile dependencies
-xM1                          Generate makefile dependencies, but exclude /usr/include
-xMD                          Generate makefile dependencies and compile at once
-xMMD                         Generate makefile dependencies like -xMD, but excluding standard headers
-xMF <file>                   Specify output <file> for makefile dependencies dump
-xMerge                       Merge data segment into text segment
-xO<n>                        Generate optimized code; <n>={1|2|3|4|5}
-xaddr32[={yes|no}]           Generate binaries assuming the associated process is restricted to the lower 32bit address space
-xalias_level[=<a>]           Enable optimizations based on the specified alias_level;
                              <a>={any|simple|compatible}
-xanalyze=code                Generate static analysis information for the code analyzer
-xannotate[={yes|no}]         Annotate binaries for optimization and analysis
-xar                          Create archive library with instantiated templates 
-xarch=<a>                    Specify target architecture instruction set
-xautopar                     Enable automatic loop parallelization
-xbuiltin[=<a>]               Inline system functions and intrinsics when beneficial;
                              <a>={%none|%default|%all}
-xcache=<t>                   Define cache properties for use by optimizer
-xchar[=<a>]                  Treat type char as signed (s) or unsigned (u);
                              <a>={s|signed|u|unsigned}
-xcheck[=<a>[,<a>]]           Generate runtime checks for error condition;
                              <a>={stkovf,init_local}
-xchip=<a>                    Specify the target processor for use by the optimizer
-xcode=<a>                    Generate different code for forming addresses; <a>={pic13|pic32}
-xdebugformat=<a>             Selects the format of debugging information; <a>={stabs|dwarf}
-xdepend[={yes|no}]           Analyze loops for data dependencies
-xdumpmacros[=<a>[,<a>]]      Prints macro definitions on the standard error output;
                              <a>={defs,undefs,use,loc,conds,sys}
-xdryrun                      The same as -###
-xe                           Perform only syntax/semantic checking, no code generation
-xhelp=<a>                    Display on-line help information; <a>={flags|readme}
-xia                          Enable interval arithmetic
-xinline=<v>                  Attempt inlining of specified user routines; <v>={%auto,<func>,no%<func>}
-xinstrument=[no_]datarace    Enable/disable instrumentation for race detection tool
-xipo[=<n>]                   Enable optimization and inlining across source files; <n>={0|1|2}
-xipo_archive=<a>             Enable crossfile optimization including archive files;
                              <a>={none|readonly|writeback}
-xivdep[=<a>]                 Ignore loop-carried dependences on array references in a loop; <a>={loop|loop_any|back|back_any|none}
-xjobs=<n>                    Maximum number of components compiler will fork in parallel
-xkeepframe[=<v>]             Do not optimize stack frame of specified user routine; <v>={%all|%none|[no%]<func>}
-xlang=<a>[,<a>]              The set of languages used in the program; <a>={f90,f95,c99}
-xldscope=<a>                 Indicates the appropriate linker scoping within the source program;
                              <a>={global|symbolic|hidden}
-xlibmieee                    Force IEEE 754 return values for math routines in exceptional cases
-xlibmil                      Inline selected libm math routines for optimization
-xlibmopt                     Link with optimized math library
-xlic_lib=sunperf             (Obsolete) Use -library=sunperf instead
-xloopinfo                    Show loops that parallelized
-xmaxopt=[off,1,2,3,4,5]      Maximum optimization level allowed on #pragma opt
-xmodel=<a>                   Specify memory model for 64-bit programs;
                              <a>={small|kernel|medium}
-xnolib                       Do not link with default system libraries
-xnolibmil                    Cancel -xlibmil on command line
-xnolibmopt                   Cancel -xlibmopt on command line
-xnorunpath                   Do not build a runtime search path into the executable
-xopenmp[=<a>]                Enable OpenMP language extension; <a>={none|noopt|parallel}
-xpagesize=<a>                Controls the preferred page size for the stack and for the heap; <a>={4K|2M|4M|1G|default}
-xpagesize_heap=<a>           Controls the preferred page size for the heap; <a>={4K|2M|4M|1G|default}
-xpagesize_stack=<a>          Controls the preferred page size for the stack; <a>={4K|2M|4M|1G|default}
-xpch=<t>                     Enable precompiled headers. Collect data for, or use existing, PCH file; <t>={auto|autofirst|{collect,use}:<file>[.cpch]}
-xpchstop=<file>              Specified include file marks end of initial common sequence of pre-processing directives for precompiled headers
-xpec[={yes|no}]              Generate a PEC binary
-xpg                          Compile for profiling with gprof
-xport64[=<a>]                Enable extra checking for code ported from 32-bit to 64-bit platforms;
                              <a>={no|implicit|full}
-xprefetch[=<p>]              Specify instruction prefetch; <p>={auto,no%auto,explicit,no%explicit}
-xprefetch_auto_type=<a>      Specify automatic indirect prefetch insertion for loops;
                              <a>={indirect_array_access}
-xprefetch_level[=<n>]        Controls the aggressiveness of the -xprefetch=auto option; <n>={1|2|3}
-xprofile=<t>                 Collect data for a profile or use a profile to optimize; <t>={{collect,use}[:<path>],tcov}
-xprofile_ircache[=<t>]       Path to intermediate file cache used with -xprofile option
-xreduction                   Recognize reduction operations in parallelized loops
-xregs=<a>[,<a>]              Specify the usage of optional registers; <a>={frameptr}
-xrestrict[=<f>]              Treat pointer valued function parameters as restricted; <f>={%none,%all,<function-name list>}
-xs                           Allow debugging without object (.o) files
-xspace                       Do not do optimizations that increase code size
-xtarget=<a>                  Specify target system for optimization
-xtemp=<dir>                  Set directory for temporary files to <dir>
-xthreadvar[=<a>]             Control code generation for thread variables; <a>={dynamic}
-xtime[=<a>]                  Report the execution time for each compilation phase; <a>={1|2|3}
-xtrigraphs[={yes|no}]        Enable|disable trigraph translation
-xunroll=<n>                  Enable unrolling loops <n> times where possible
-xustr=<a>                    Recognize sixteen-bit string literals; <a>={ascii_utf16_ushort|no}
-xvector[=<a>[,<a>]]          Automatic generation of calls to the vector library functions and/or the generation of the SIMD instructions
-xvpara                       Verbose parallelization warnings
-xwe                          Convert all warnings to errors

Suffix 'a'              Object library
Suffix 'il'             Inline template file
Suffix 'o'              Object file
Suffix 'so'             Shared object
Suffix 's'              Assembler source
Suffix 'S'              Assembler source for cpp
Suffix 'c'              C++ source
Suffix 'cc'             C++ source
Suffix 'cxx'            C++ source
Suffix 'cpp'            C++ source
Suffix 'C'              C++ source
Suffix 'c++'            C++ source
Suffix 'i'              C++ source after preprocessing
Suffix 'err'            ld error file
Suffix 'd'              Build dependencies file
#define __LINE__ 
#define __FILE__ 
#define __STDC__ 0
#define __STDC_VERSION__ 199409L
#define __DATE__ "Jun  9 2016"
#define __TIME__ "09:09:48"
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
#define __STDC_HOSTED__ 1
#define __SunOS_5_11 1
#define __SUNPRO_C 0x5120
#define __unix 1
#define __SVR4 1
#define __sun 1
#define __SunOS 1
#define __i386 1
#define __BUILTIN_VA_ARG_INCR 1
#define __C99FEATURES__ 1
#define __PRAGMA_REDEFINE_EXTNAME 1
#define unix 1
#define sun 1
#define i386 1
#define __RESTRICT 1
#define __FLT_EVAL_METHOD__ - 1
#define __SUN_PREFETCH 1
#define __NOVECTORSIZE__ 1
# 1 "/dev/null"
#ident "acomp: Sun C 5.12 SunOS_i386 2011/11/16"