Peter Schorn wrote:
I have a question on the meaning of the identifier-case warning in gpc (gpc345u2 on Mac OS 10.4.4). Compiling the program below I get three warnings but I'd expect none since in all three cases the two referenced variables are different.
Is my expectation wrong?
Best regards, Peter
{ 1} program cap; { 2} { compile with gpc -o cap -Widentifier-case cap.pas } { 3} { 4} procedure p(A: integer); { 5} { 6} procedure q(a: integer); { cap.pas:6: warning: capitalisation of identifier `a' doesn't match } { 8} { cap.pas:4: warning: previous capitalisation `A' } { 9} begin {10} a := 1; {11} end; {12} {13} begin { p } {14} A := 0; { cap.pas:14: warning: capitalisation of identifier `A' doesn't match } {16} { cap.pas:6: warning: previous capitalisation `a' } {17} end; {18} {19} procedure r(a: integer); { cap.pas:19: warning: capitalisation of identifier `a' doesn't match } {21} { cap.pas:14: warning: previous capitalisation `A' } {22} begin {23} a := 1; {24} end; {25} {26} begin {27} end.
There have been comments about this warning in the past (and I agree with the critics), see e.g. http://www.gnu-pascal.de/crystal/gpc/en/thread10736.html.
Regards,
Adriaan van Os