Comment on UndefinedBehaviorSanitizer's Unexpected BehaviorComments−Someone1yI 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.
Comments
I would think the proper way to do this would be
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.