Re: Debugging Macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Browder wrote:
I'm trying to debug a gcc frontend (cobol for gcc) and get errors such as:

../../gcctrunk_with_cobol/gcc/cobol/cobcbei.c:462: error: invalid
application of 'sizeof' to incomplete type 'struct lang_identifier'
../../gcctrunk_with_cobol/gcc/cobol/cobcbei.c:462: error: 'getdecls'
undeclared here (not in a function)
../../gcctrunk_with_cobol/gcc/cobol/cobcbei.c:468: error: conflicting
types for 'tree_code_type'

which come from nested macros in gcc code.

Is there an easy way (such as defining an environment variable in the
build environment) to get the gcc build system to show the
preprocessed code to help backtrack the problem?

Set your CC when running make: "make CC='gcc -g -save-temps -Wp,-dD ...'

This will give you all macro definitions, expanded in .i files.

For extra credit, run the .i files through GNU indent.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux