I wrote:
I wrote:
If so, it would be helpful if GPC issued a warning in this case, e.g, "result of comparison is always false" (note that GCC does this in some cases, e.g., comparison of unsigned value >= 0).
Good idea. In fact, I made the warnings a bit more extensive (maybe overkill ...), see the test programs. Of course, they still can't catch all cases of unintentionally confusing padding and non-padding comparisons.
Just a little correction to the messages.
I think my previous patch is too noisy. Comparisons of two string constants shouldn't be warned (at least not by default). E.g., in my own code, I sometimes do things like that: { Configuration file } const LogFileName = ''; { optional } { Main code } if LogFileName <> '' then { ... } This would warn whenever LogFileName is set because of the different lengths of the empty and a nonempty string. I think that's overkill. So the following patch disables the warning for this case (and does another small internal cleanup). Frank -- Frank Heckenbach, f.heckenbach@fh-soft.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8