ca65 warning "Suspicious address expression" for direct page

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
ca65 warning "Suspicious address expression" for direct page
by on (#152172)
In this post, Movax12 wrote:
The warning "Suspicious address expression" is a warning for when you load a high or low byte of a label and don't use the immediate operator

In the following contrived code, why is it still "suspicious" to use the .lobyte with a nonzero direct page base?
Code:
.p816
VMDATA = $002118
.smart
.segment "CODE"
  sep #$20
  pea linebuf & $00FF00
  pld
  lda <linebuf    ; This is suspicious
  lda z:<linebuf  ; So is this
  lda z:linebuf   ; And this just makes a range error
  pea VMDATA & $00FF00
  pld
  sta <VMDATA     ; But this isn't
forever: jmp forever
.segment "BSS"  ; linker script puts this in $000200-$001FFF
linebuf: .res 32

And how should I reassure ca65 that I know what I doing?
Re: ca65 warning "Suspicious address expression" for direct
by on (#152223)
Seems to me that the "suspicious" warning should be implicitly silenced in 65816 mode. Maybe we could add a "dp:" address operator that forces one byte operand without complaints?
Re: ca65 warning "Suspicious address expression" for direct
by on (#152530)
This issue caused me to create a GitHub account. Issue 194
Re: ca65 warning "Suspicious address expression" for direct
by on (#152624)
This is slightly off topic but: am I the only one who is shocked to hear that tepples just now got a GitHub? XD