Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2410

Casting function pointers to different types

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.8.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Keith Bostic (Inactive)
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: