OpenPrinting / libcupsfilters

Apache License 2.0
5 stars 22 forks source link

fails to build with libc++ by default #35

Closed nekopsykose closed 8 months ago

nekopsykose commented 1 year ago

this is because:

so, you get:

../cupsfilters/pdftoraster.cxx:2204:34: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
void * operator new(size_t size) _GLIBCXX_THROW (std::bad_alloc)
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cupsfilters/pdftoraster.cxx:2201:24: note: expanded from macro '_GLIBCXX_THROW'
#define _GLIBCXX_THROW throw

in libstdc++ itself, _GLIBCXX_THROW expands to nothing for c++ >=11: https://github.com/gcc-mirror/gcc/blob/1e6815071fd137424f79ca79a6ba66b776a98778/libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig#L219

since the codebase already uses std=c++17, the best solution is to just remove the throw specifiers entirely

nekopsykose commented 1 year ago

the entire operator new/delete wrapper could just be deleted since it's not really doing anything

nekopsykose commented 8 months ago

thanks!