This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/43778] C/C++ __attribute__((deprecated)) does not appear to wrap declarations as implied from the doc.
- From: "iains at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Apr 2010 19:03:18 -0000
- Subject: [Bug c/43778] C/C++ __attribute__((deprecated)) does not appear to wrap declarations as implied from the doc.
- References: <bug-43778-19002@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from iains at gcc dot gnu dot org 2010-04-18 19:03 -------
(In reply to comment #2)
> "warnings should be issued when a
> deprecated entity is used and not when that deprecation is declared."
>
> it is not "that" deprecation that is declared in your examples but "a"
> deprecation that is declared.
With that I agree - however, my comment on the inconsistency of the semantics
remains.
I appreciate that, since this is a gnu extension, there is no spec to follow.
It is a question of what is most useful behavior.
At present:
typedef int INT1 __attribute__((deprecated));
INT1 func(void )__attribute__((deprecated));
produces no warning -- to me this makes sense - it is unimportant that INT1 is
deprecated, unless one tries to call "func()" in which case a warning is given
for the use of func().
At present, this produces a warning (C) for the argument:
INT1 func(INT1 )__attribute__((deprecated));
However, one asks what's the purpose of the warning?
func() is deprecated, a warning would be issued if one were to try and use
it...
===
In a practical sense - one could have deprecated interfaces in a header.
I would expect that those interfaces should not produce any warnings *unless* I
were to use them in my code.
The fact that deprecated interface A depends on deprecated interface B is not
relevant unless one tries to use A.
or at least, that was my understanding of the intention of the behavior.
Incidentally, C++ does not produce a warning for INT1 func(INT1
)__attribute__((deprecated));
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43778