XLC

From Parts
Jump to: navigation, search

How to generate a bug report

It is very useful to generate a standalone test case to reproduce C/C++ bugs. Here is how:

Let's say this doesn't work with XL:

${COMPILER} ${CPPFLAGS} ${CFLAGS} -c ${SOURCE} -o ${OBJECT}

The following should generate a standalone file:

${COMPILER} ${CPPFLAGS} ${CFLAGS} -E ${SOURCE} >& ${STANDLONE_SOURCE}

One should be able to reproduce the bug using only the following:

${COMPILER} ${CFLAGS} -c ${STANDLONE_SOURCE}

This eliminates the need to include external header dependency in C/C++ code. I know of no equivalent for Fortran.

Example

This:

bgxlC_r -I/bgsys/drivers/ppcfloor/ -c builtins.C 

Should generate the same result as this:

bgxlC_r -I/bgsys/drivers/ppcfloor/ -E builtins.C >& builtins.i
bgxlC_r -c builtins.i

False Warnings

Ignore warnings like this:

The pragma GCC system_header directive is only permitted in an include file. The pragma will be ignored.
Personal tools