Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


jdhedden at cpan

Nov 2, 2009, 7:05 AM

Post #1 of 7 (96 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7

> commit 879d0c7269cae2ffd414e7e03bcd3bc03ba587d3
> Author: Nicholas Clark <nick[at]ccl4.org>
> Date:   Sun Nov 1 16:43:22 2009 +0000
>
>    Remove Perl_pmflag() from the public API, and mark it as deprecated.
>
>    regcomp.c stopped using it before 5.10, leaving only toke.c. The only code on
>    CPAN that uses it is copies of regcomp.c. Replace it with a static function,
>    with a cleaner interface.

Does something else need to be done to remove this build warning?

gcc -c -I. -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS
-fno-strict-aliasing -pipe -DUSEIMPORTLIB -Os -pipe -funit-at-a-time
-march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2
-DVERSION=\"0.17\" -DXS_VERSION=\"0.17\" "-I../.." APItest.c
APItest.xs: In function `XS_XS__APItest_pmflag':
APItest.xs:930: warning: `Perl_pmflag' is deprecated (declared at
../../proto.h:2505)


nick at ccl4

Nov 2, 2009, 7:42 AM

Post #2 of 7 (88 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7 [In reply to]

On Mon, Nov 02, 2009 at 10:05:27AM -0500, Jerry D. Hedden wrote:
> > commit 879d0c7269cae2ffd414e7e03bcd3bc03ba587d3
> > Author: Nicholas Clark <nick[at]ccl4.org>
> > Date:   Sun Nov 1 16:43:22 2009 +0000
> >
> >    Remove Perl_pmflag() from the public API, and mark it as deprecated.
> >
> >    regcomp.c stopped using it before 5.10, leaving only toke.c. The only code on
> >    CPAN that uses it is copies of regcomp.c. Replace it with a static function,
> >    with a cleaner interface.
>
> Does something else need to be done to remove this build warning?
>
> gcc -c -I. -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS
> -fno-strict-aliasing -pipe -DUSEIMPORTLIB -Os -pipe -funit-at-a-time
> -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2
> -DVERSION=\"0.17\" -DXS_VERSION=\"0.17\" "-I../.." APItest.c
> APItest.xs: In function `XS_XS__APItest_pmflag':
> APItest.xs:930: warning: `Perl_pmflag' is deprecated (declared at
> ../../proto.h:2505)

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"

Nicholas Clark


ben at morrow

Nov 2, 2009, 2:33 PM

Post #3 of 7 (85 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7 [In reply to]

Quoth nick[at]ccl4.org (Nicholas Clark):
> On Mon, Nov 02, 2009 at 10:05:27AM -0500, Jerry D. Hedden wrote:
> >
> > gcc -c -I. -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS
> > -fno-strict-aliasing -pipe -DUSEIMPORTLIB -Os -pipe -funit-at-a-time
> > -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2
> > -DVERSION=\"0.17\" -DXS_VERSION=\"0.17\" "-I../.." APItest.c
> > APItest.xs: In function `XS_XS__APItest_pmflag':
> > APItest.xs:930: warning: `Perl_pmflag' is deprecated (declared at
> > ../../proto.h:2505)
>
> 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.

Ben


jdhedden at cpan

Nov 4, 2009, 7:24 AM

Post #4 of 7 (72 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7 [In reply to]

On Mon, Nov 2, 2009 at 17:33, Ben Morrow <ben[at]morrow.me.uk> wrote:
> Quoth nick[at]ccl4.org (Nicholas Clark):
>> On Mon, Nov 02, 2009 at 10:05:27AM -0500, Jerry D. Hedden wrote:
>> >
>> > gcc -c  -I. -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS
>> > -fno-strict-aliasing -pipe -DUSEIMPORTLIB -Os -pipe -funit-at-a-time
>> > -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2
>> > -DVERSION=\"0.17\" -DXS_VERSION=\"0.17\"  "-I../.."   APItest.c
>> > APItest.xs: In function `XS_XS__APItest_pmflag':
>> > APItest.xs:930: warning: `Perl_pmflag' is deprecated (declared at
>> > ../../proto.h:2505)
>>
>> 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.


ben at morrow

Nov 4, 2009, 8:18 AM

Post #5 of 7 (72 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7 [In reply to]

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?

Ben


jdhedden at cpan

Nov 4, 2009, 8:33 AM

Post #6 of 7 (72 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.


ben at morrow

Nov 4, 2009, 10:55 AM

Post #7 of 7 (71 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.1-103-g879d0c7 [In reply to]

Quoth jdhedden[at]cpan.org (Jerry D. Hedden):
>
> 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'.

No, probably a general fix isn't useful, but getting into the habit of
ignoring core build warnings isn't a good idea either. Below is a minimal
fix, just for XS::APItest.

Ben

diff --git a/perl.h b/perl.h
index 9f80c5b..f1b3a04 100644
--- a/perl.h
+++ b/perl.h
@@ -3187,7 +3187,8 @@ typedef pthread_key_t perl_key;
# endif
#endif

-#ifdef HASATTRIBUTE_DEPRECATED
+/* XS::APItest tests deprecated functions */
+#if defined(HASATTRIBUTE_DEPRECATED) && !defined(PERL_IN_XS_APITEST)
# define __attribute__deprecated__ __attribute__((deprecated))
#endif
#ifdef HASATTRIBUTE_FORMAT

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.