Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   rillig
Date:           Tue Jan  5 23:07:49 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_long_double_int.exp msg_124.exp
            msg_230.exp
        src/usr.bin/xlint/lint1: ops.def

Log Message:
lint: clean up symbolic operator names that are used in the messages

Including the "p" in the symbolic operator names was questionable, for
several reasons:

1.  The "p" could be taken to mean an actual variable name, which is
    confusing if the function doesn't have such a variable, or even more
    so if the line contains an unrelated variable called "p".

2.  For the binary operators, having the "p" mentioned on both sides of
    the operator (such as in "p + p") wrongly suggested that both
    operands of the expression were the same.

3.  The name "p" often stands for a pointer.  Most of the operators
    don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators.  This makes several pairs of operators indistinguishable:

    INCBEF == INCAFT
    DECBEF == DECAFT
    UPLUS == PLUS
    UMINUS == MINUS
    STAR == MULT
    AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp \
    src/tests/usr.bin/xlint/lint1/msg_230.exp
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/lint1/ops.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index