Casting function pointers to different types

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • WT2.8.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None

      I noticed in a recent code review that we are casting function pointers to functions with different types in. For example:

      https://github.com/wiredtiger/wiredtiger/blob/develop/src/cursor/cur_std.c#L55

      I did some digging, and it appears that doing so is undefined according to the C99 standard. See: http://stackoverflow.com/questions/559581/casting-a-function-pointer-to-another-type

      On the other hand it is used by a bunch of common system libraries, so the expectation is that it will work.

            Assignee:
            Keith Bostic (Inactive)
            Reporter:
            Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: