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

Casting function pointers to different types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • WT2.8.0
    • None
    • 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

              keith.bostic@mongodb.com Keith Bostic (Inactive)
              alexander.gorrod@mongodb.com Alexander Gorrod
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: