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

Casting function pointers to different types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.8.0
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                keith.bostic Keith Bostic
                Reporter:
                alexander.gorrod Alexander Gorrod
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: