https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82316

--- Comment #4 from Jordi Vilar <development at jordi dot vilar.cat> ---
I'm sorry if I didn't explain it correctly.

I don't claim that a extern "C" declarations have to be interpreted as C in a
C++ translation unit. What I say is that most C libraries (libtiff, zlib, lcms,
etc.) provide a header that assumes that the C api can be reused for C++ just
by wrapping it with extern "C" {}. If a C library uses register in its api
declarations, then that legitimate C declarations no longer can be used in C++
code not even wrapped by extern "C". This is a breaking movement.

Supressing the warning in extern "C" declarations doesn't imply parsing it as
C, because it is actually a C++ translation, but would enable continuing using
the traditional C libraries.

For an example of C library that uses register in its api, you can take a look
on the little cms (lcms) that is included in most linux distributions. It just
has the classic #ifdef __cplusplus extern "C" { #endif and tons of register
function arguments.

Should C++17 applications REJECT all of those ligitimate C libraries?

Reply via email to