Menu

#1014 Implicit conversion from Any Ptr should cause error

open
nobody
None
compiler
2025-11-17
2025-11-16
Rule
No

Implicit conversion from Any Ptr to a pointer of a type other than Any is unsafe and should cause a compile-time error, or at least a warning.

I consider this a bug and not a feature request.

Discussion

  • fxm (freebasic.net)

    Behavior identical to that in C where a pointer to 'void' can be implicitly converted to and from any pointer to object type.

    Furthermore, FreeBASIC even allows implicit conversion between an 'Any Ptr' and a procedure pointer, and vice versa.

     

    Last edit: fxm (freebasic.net) 2025-11-16
  • Rule

    Rule - 2025-11-17

    C permits it, C++ does not.

     

Log in to post a comment.

Monday.com Logo