"GUI" means "graphical user interface"hgm wrote:Receiving non-compliant input must by necessity result in undefined behavior, or it would be impossible to extend the protocol. What is non-compliant now, could be in the protcol specs next year. If the protocol would guarantee that it was ignored, you would break compatibilty by that, because you will not add a new command for the purpose of being ignored.
I think it is also desirable to hve an opportunity to add undocumented commands, not mentioned in the specs, because they do not completely do what I want yet, or because I want to keep the possibility open to change their behavior. And changing behavior without breaking compatibility is only possible as long as the behavior is still undefined.
If you want to extend the protocol then simply do it, and change the implementation of your GUI accordingly. After doing that, your old GUI version is based on the previous protocol spec document version (short "spec version") and the new GUI version on the recent one. Both can specify that the GUI ignores all input lines that are not otherwise covered by the current spec version. In general, you have a model similar to this example:
Spec versions: P1, P2, P3 (this is *not* meant as the "protover" version v1/v2!)
GUIs: GUI-A, GUI-B, GUI-C (e.g. WinBoard, ChessGUI, Arena)
GUI versions and their conformance to spec versions:
GUI-A-v1 conforms to P1
GUI-A-v2 conforms to P2
GUI-A-v3 conforms to P3
GUI-B-v1 conforms to P1
GUI-B-v2 still conforms to P1 (P2 changes not yet implemented)
GUI-B-v3 conforms to P2
GUI-B-v4 conforms to P3
GUI-C-v1 conforms to P1
GUI-C-v2 conforms to P2
GUI-C-v3 still conforms to P2 (P3 changes not yet implemented)
Even if you do not explicitly keep track of spec versions (I would like it if you did, though) the model remains the same. You can extend the protocol, e.g. by a new command or a new parameter for the "feature" command. GUIs not yet implementing that new spec version will still ignore the new command until they upgrade to the new spec version. Where is the problem?
No, it is not "bad programming". Using strstr() is correct for detecting substrings while strncmp() is correct for detecting exact matches of the first N characters of a string. In the given case, both are "good programming" but the former is wrong w.r.t. the current spec version. So please, accept the bug and don't beat around the bush!hgm wrote:As to the usage of strstr: yes, I think that is bad programming, and could be improved. But making changes just to alter behavior that is not specified in the first place and can only occur due to engines violating the specs does have a lower priority than creating new specified functionality.
Regarding your priorities, I doubt that it is a good policy to always prefer creating new functionality (and thereby potentially more bugs) over fixing known existing bugs. Fixing that one here is cheap, and there is no way for anyone to complain about that fix. Talking two days about it but still not doing the fix is not so cheap
Sven
