0

if you have the same end function from a product but some logic statements were shuffled around from one c file (program1.c) to another c file (program2.c) eg

//program1.c
...
UINT8 VarA; //declared globally
UINT8 VarB;
UINT8 VarC;
<some code here "excerpt A">
if (VarA >= VarB){
VarC = VarA+1;
...
}

and

//program2.c
...
<some code>;
...

Compared to output of these files when linker makes the final hex file.

//program1.c
...
<some code>;
...

and this

//program2.c
...
UINT8 VarA; //declared globally
UINT8 VarB;
UINT8 VarC;
<some code here "excerpt A"> 
if (VarA >= VarB){
VarC = VarA+1;
...
}

"excerpt A" is used to denote the exact same code the exact. assume that the only difference is whats showing between the codes.

What is the codes were slightly different but the output hex files functioned exactly the same? Would you expect the hex file to be different?

newb7777
  • 517
  • 5
  • 22
  • What do you mean with "hex file"? Do you want to dump the object files as hex(adecimal) numbers (i.e. [Hex Dump](https://en.wikipedia.org/wiki/Hex_dump)? There are existing tools for this, e.g. [`hexdump`](http://archive.oreilly.com/linux/cmd/cmd.csp?path=h/hexdump) but you can easily write your own with a few number of lines... (e.g. [SO: how to get hexdump of a structure data](https://stackoverflow.com/q/7775991/7478597)). – Scheff's Cat Aug 02 '17 at 06:13
  • @ Scheff. It is the file format of an embedded system like a PIC processor compiled with MPLAB-X tool. Usually the hex file is used to program an embedded PIC processor. – newb7777 Aug 02 '17 at 06:20
  • 1
    OK. I think it was worth to mention this. May be, you should [edit] your question... – Scheff's Cat Aug 02 '17 at 06:21

0 Answers0