
jdhedden at cpan
Nov 4, 2009, 8:33 AM
Post #6 of 7
(71 views)
Permalink
|
|
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7
[In reply to]
|
|
On Wed, Nov 4, 2009 at 11:18, Ben Morrow <ben[at]morrow.me.uk> wrote: > Quoth jdhedden[at]cpan.org (Jerry D. Hedden): >> On Mon, Nov 2, 2009 at 17:33, Ben Morrow <ben[at]morrow.me.uk> wrote: >> > Quoth nick[at]ccl4.org (Nicholas Clark): >> >> >> >> I don't know if it's possible to both >> >> >> >> 1: Mark the function as deprecated with an attribute >> >> 2: Write a test for it >> >> >> >> and if only one is possible, I'd prefer to have the test. >> >> Although we could move it to a file named something like "test deprecated >> >> things" >> > >> > Adding >> > >> > #pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> > >> > as the very first line in APItest.xs will disable the warning for this >> > file (it's not possible to control this with finer granularity than a >> > whole file). I don't know how stable this is likely to be across GCC >> > versions, nor if we are making other compilers emit deprecated warnings. >> >> Nice idea, but it doesn't work with gcc 3.4.4. > > Hmm. The obvious next idea is to add a PERL_NO_DEPRECATIONS macro that > disables the use of __attribute__((deprecated)) altogether, but I'm not > sure that's a good idea. The chances of people misusing it the way they > misuse PERL_CORE seem rather high. > > AFAICS the only other option (besides abandoning the attribute > altogether) is to have either Configure or XS-APItest's Makefile.PL test > for -Wno-deprecated-declarations the same way it tests for the other -W > options, and add it to the compile line of APItest.c if it's available. > Or is it the option, rather than the pragma, that doesn't exist on > 3.4.4? I'm not sure it's worth the effort to engineer a 'fix' for this even though I like to see a squeaky-clean 'make'. As to gcc 3.4.4, it didn't balk at the use of the pragma, but it didn't do anything - the warning still appeared.
|