If I insert a comment on a source code will it`s binarries MD5 be changed?

I`m just wondering.... If it was the case that I was thinking in creating different reseases for each custumer that I sold my software, could I check each one with MD5 just changing a comment inside the source code and recompiling? I mean, will a ##comment inside a C++, C# or java code change the binnary MD5?

Answer:1

Comments are removed early in (or before) the compilation process, so inserting a comment will not change the hash of the compiled binary.

The only exception (that I can think of) is if your binaries include line numbers, which can change based on comments. Typically this happens when you're compiling in debug mode, but you can also force it using something like the __LINE__ macro in C++. But even in this case, the content of the comment is irrelevant, only how many lines it takes up (so you might as well just use blank lines for that purpose). Besides, released software probably shouldn't include that information.

Answer:2

Short answer is no. Comments are stripped out very early in the compilation process.

The longer answer is, sometimes - but not reliably. There's a number of foreseeable reasons that vestiges (more like side-effects) of the comment could show up. However, those are fragile at best.

I assume this is for some sort of automated process, like selling the software on a website. How about outputting a header file like "user.h" that simply specifies the name/email/username/etc as a #define'd string, and then printing that somewhere in your program's About screen (both for the user's benefit and so the compiler doesn't optimize it away)? It requires you to recompile your program for each user, but that may not be a problem if it only takes a few seconds to build.

Answer:3

A comment cannot be compiled to a cpu opcode so it will not change the hash of the blob.

Answer:4

Because codenameone can not use external libraries (HttpConnection) then I have to use the internal library / API provided Codenameone, it's just that I've managed to post the data to format text / ...

I have a Java 7 code, where I'm playing with MethodHanlde. The code is : import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; class ...

OSX apps have a Help menu on the right of the menu bar. When the Help menu is click, a menu opens with a search box at the top and a few menu items under it. How can this be achieved in a Java Swing ...

I need a rounding function that returns a larger integer when the input is positive and the a smaller number when negative, i.e. it should not return 0 unless the input is actually 0.0. Examples: f(...