4 pointsby yairlenga7 hours ago2 comments
  • tnelsond45 hours ago
    GCC -Wall what tells me about most implicit casts going on (which I mostly ignore). But not all of them.

    I think these cast problems are ultimately something that the compiler can and should catch. And a stronger type enforcement system would be nice, but also I use C so i don't have to deal with rust's nonsense

  • yairlenga7 hours ago
    I ran into a few subtle bugs around casts in C—mostly pointer precedence and intent not being obvious in reviews.

    Things like (long *)buf + 1 are easy to misread at a glance.

    I tried making casts more explicit with small macros (CAST_PTR1, etc.) and adding some compile-time checks.

    Curious how others deal with this—warnings, conventions, or just careful review?