Warn once for a deprecated class, and not each instantiation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We have a C++ header-only class that needs to change due to a bug. We
marked it as deprecated:

template <class C1, class C2 = X, class C3 = Y>
struct BAD_CLASS
    : ...
{
    ...

} __attribute__((deprecated ("BAD_CLASS will be changing in the near
future due to (1) an implementation bug and (2) an interop issue.")));

Each instantiation produces a separate, multiline warning. The
intention is to warn the user (once), and not repeatedly warn the user
(multiple times). We expect those who are mindful of warnings "get it"
the first time. For others, it does not matter how many times its
repeated because they are going to ignore it.

Is it possible to "warn once" in this situation? If so, how?

Does GCC have something Microsoft's "pragma once(...)" for warnings?

Thanks in advance.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux