fix: 5 dead-code warnings in main.c (expression generates no code) #18

Closed
opened 2026-07-27 00:29:22 +00:00 by time · 3 comments
Contributor

XC8 reports 5 expression-generates-no-code warnings at lines 171, 185, 340, 350, 359 in main.c. These are standalone side-effect-free expressions that should either be removed or have a comment explaining why they are there.

XC8 reports 5 expression-generates-no-code warnings at lines 171, 185, 340, 350, 359 in main.c. These are standalone side-effect-free expressions that should either be removed or have a comment explaining why they are there.
Owner

Those lines should do something, but they are being optimized out. Not sure why pin_write calls would be getting dropped, though.

Those lines *should* do something, but they are being optimized out. Not sure why pin_write calls would be getting dropped, though.
Author
Contributor

Fixed in PR #19: replaced ternary pin_write macro with direct LATAx = val writes to XC8's volatile __bit variables, which the compiler cannot optimize away.

Fixed in PR #19: replaced ternary `pin_write` macro with direct `LATAx = val` writes to XC8's `volatile __bit` variables, which the compiler cannot optimize away.
Owner

Verified

Verified
daru closed this issue 2026-07-27 01:03:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
daru/PICsense#18
No description provided.