Skip to content

Comment on UndefinedBehaviorSanitizer's Unexpected Behavior

Comments

I would think the proper way to do this would be

  #if defined(BUILDING_LIBCURL)
    struct Curl_easy {
      …
    }
  #else
    struct Curl_easy;
  #endif
  typedef struct Curl_easy CURL;
If BUILDING_LIBCURL isn’t defined that tells code “CURL is identical to a struct named Curl_easy”. If it is defined, that also tells code what fields it has.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.