libcsptr icon indicating copy to clipboard operation
libcsptr copied to clipboard

not support MSVC

Open tkorays opened this issue 2 years ago • 4 comments

We use C in windows with MSVC compiler, but __attribute__((cleanup)) does not work in MSVC. Is is possible to support MSVC?

tkorays avatar Nov 04 '22 05:11 tkorays

Not really. MSVC has no practical equivalent to the cleanup attribute, which is why there is a disclaimer that this only works for GNU C.

Snaipe avatar Nov 04 '22 07:11 Snaipe

Clang and Intel C Compiler supposedly support this. https://clang.llvm.org/docs/AttributeReference.html#cleanup https://community.intel.com/t5/Intel-C-Compiler/variable-attribute-cleanup-support/td-p/777276

bogen85 avatar Nov 04 '22 08:11 bogen85

Yes, clang and icc count as a GNU-flavored C, since they want to match GCC's general behavior. But MSVC does not, and therefore cannot work with this library.

Snaipe avatar Nov 04 '22 08:11 Snaipe