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.
This commit is contained in:
rillig 2021-01-05 23:07:49 +00:00
parent 3796e6d449
commit b8104292aa
4 changed files with 54 additions and 54 deletions

View File

@ -1 +1 @@
(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op p == p [124]
(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op == [124]

View File

@ -1,3 +1,3 @@
msg_124.c(16): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op p = p [124]
msg_124.c(17): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op p = p [124]
msg_124.c(18): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op p = p [124]
msg_124.c(16): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op = [124]
msg_124.c(17): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op = [124]
msg_124.c(18): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op = [124]

View File

@ -1,3 +1,3 @@
msg_230.c(11): warning: comparison of unsigned char with 0, op p < p [162]
msg_230.c(22): warning: nonportable character comparison, op p <= p [230]
msg_230.c(23): warning: comparison of unsigned char with negative constant, op p <= p [162]
msg_230.c(11): warning: comparison of unsigned char with 0, op < [162]
msg_230.c(22): warning: nonportable character comparison, op <= [230]
msg_230.c(23): warning: comparison of unsigned char with negative constant, op <= [162]

View File

@ -3,60 +3,60 @@ ARROW -> 1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 1
POINT . 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1
NOT ! 0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0 1
COMPL ~ 0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1 1
INC p + 1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
DEC p - 1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
INCBEF ++p 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0 1
DECBEF --p 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0 1
INCAFT p++ 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0 1
DECAFT p-- 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0 1
UPLUS +p 0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,0 1
UMINUS -p 0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0 1
STAR *p 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 1
AMPER &p 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1
MULT p * p 1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0 1
DIV p / p 1,0,0,0,1,1,1,0,1,0,1,1,0,0,0,1,1,0 1
MOD p % p 1,0,1,0,0,1,1,0,1,0,1,1,0,0,0,1,1,0 1
PLUS p + p 1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0 1
MINUS p - p 1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0 1
SHL p << p 1,0,1,0,0,1,1,0,0,0,0,0,1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STRING string 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1
FSEL fsel 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1
CALL p() 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 1
CALL call 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 1
COMMA , 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 1
CVT (cast)p 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 1
CVT convert 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 1
ICALL icall 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 1
LOAD load 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1
PUSH push 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 1
RETURN return 1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0 1
REAL p.re 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
IMAG p.im 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
INIT p = {} 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 1 pseudo
REAL real 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
IMAG imag 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
INIT init 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 1 pseudo
CASE case 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0 pseudo
FARG f(p) 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 1 pseudo
FARG farg 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 1 pseudo