This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using GCC to verify code has no "functional change".


I work on a project which uses a mismash of coding styles. We are planning to
use an auto-formatting tool (uncrustify) to apply a consistent style format
across the codebase.

I'd like to be able to verify that uncrustify has not caused in any functional
change to the compiled code. So far, the best approach I have is to compile to
assembler before & after the style change, and then diff the resulting assembler
files. This is a little unwieldy because line numbers change, and so I need to
strip out a bunch of compiler directives before making the comparison.

It seems like a better way to do this is to compile my before/after source with
-fdump-tree-original-all, and diff the resulting dumps. Then I don't need to
munge the dumps at all. I tried this on a small example and it seems to work
quite well.

Does this sound reasonable? Is there a better way?

Cheers,

John


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]