Re: [PATCH] RE: blead: no longer supports %vd format
Rafael Garcia-Suarez wrote: >Steve Hay wrote: > > >>>Thanks, applied as change #25171 to bleadperl. >>> >>> >>> >>This change causes tons of warnings like >> >>not enough actual parameters for macro 'SVf_' >> >>on Win32. >> >>This is the bit of perl.h that causes them all: >> >>#ifndef SVf_ >># define SVf_(n) "-" #n "p" >>#endif >> >>#ifndef SVf >># define SVf SVf_() >>#endif >> >>Neither SVf_ nor SVf are initially defined, so you can see what the >>problem is. >> >>Can this be fixed? If not then perhaps revert that part of the change. >> >> > >You mean like this ? : look ok to me > Yep, that fixes it. Applied as 25174. (Thanks also to Robin who suggested the same fix.) Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
RE: [PATCH] RE: blead: no longer supports %vd format
-Original Message- From: Steve Hay To: Rafael Garcia-Suarez Cc: Robin Barker; ''The Perl5 Porters Mailing List ''; John Peacock Sent: 18/07/05 17:26 Subject: Re: [PATCH] RE: blead: no longer supports %vd format Rafael Garcia-Suarez wrote: >On 7/14/05, Robin Barker <[EMAIL PROTECTED]> wrote: > > >>Attached patch reinstates VDf in blead perl to implement the >>%vd format, which is still used in XS code and will reappear >>in blead for ... > >Thanks, applied as change #25171 to bleadperl. > This change causes tons of warnings like not enough actual parameters for macro 'SVf_' on Win32. This is the bit of perl.h that causes them all: #ifndef SVf_ # define SVf_(n) "-" #n "p" #endif #ifndef SVf # define SVf SVf_() #endif Neither SVf_ nor SVf are initially defined, so you can see what the problem is. Can this be fixed? If not then perhaps revert that part of the change. - Steve I guess the problem is the lack of parameters to SVf_, gcc does not mind, and successfully defines SVf as "-p" The simple patch is (written by hand - can't do anything clever from home): Index: perl.h #endif #ifndef SVf -# define SVf SVf_() +# define SVf "-p" #endif #ifndef SVf32 End of patch Robin --- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY ---
Re: [PATCH] RE: blead: no longer supports %vd format
Steve Hay wrote: > >Thanks, applied as change #25171 to bleadperl. > > > This change causes tons of warnings like > > not enough actual parameters for macro 'SVf_' > > on Win32. > > This is the bit of perl.h that causes them all: > > #ifndef SVf_ > # define SVf_(n) "-" #n "p" > #endif > > #ifndef SVf > # define SVf SVf_() > #endif > > Neither SVf_ nor SVf are initially defined, so you can see what the > problem is. > > Can this be fixed? If not then perhaps revert that part of the change. You mean like this ? : look ok to me Index: perl.h === --- perl.h (révision 5460) +++ perl.h (copie de travail) @@ -2635,7 +2635,7 @@ #endif #ifndef SVf -# define SVf SVf_() +# define SVf "-p" #endif #ifndef SVf32
Re: [PATCH] RE: blead: no longer supports %vd format
Rafael Garcia-Suarez wrote: >On 7/14/05, Robin Barker <[EMAIL PROTECTED]> wrote: > > >>Attached patch reinstates VDf in blead perl to implement the %vd format, >>which is still used in XS code and will reappear in blead for read-only >>version numbers. >> >>I have taken the opportunity to tidy up the code for the %p hacks that >>are used to proved SVf (was %_) and VDf. The format processing code >>does an initial pass for %p "extensions" and then resumes the previous >>processing. I have also added some comments to describe the use of %p. >> >> > >Thanks, applied as change #25171 to bleadperl. > This change causes tons of warnings like not enough actual parameters for macro 'SVf_' on Win32. This is the bit of perl.h that causes them all: #ifndef SVf_ # define SVf_(n) "-" #n "p" #endif #ifndef SVf # define SVf SVf_() #endif Neither SVf_ nor SVf are initially defined, so you can see what the problem is. Can this be fixed? If not then perhaps revert that part of the change. Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
Re: [PATCH] RE: blead: no longer supports %vd format
On 7/14/05, Robin Barker <[EMAIL PROTECTED]> wrote: > Attached patch reinstates VDf in blead perl to implement the %vd format, > which is still used in XS code and will reappear in blead for read-only > version numbers. > > I have taken the opportunity to tidy up the code for the %p hacks that > are used to proved SVf (was %_) and VDf. The format processing code > does an initial pass for %p "extensions" and then resumes the previous > processing. I have also added some comments to describe the use of %p. Thanks, applied as change #25171 to bleadperl.
Re: [PATCH] RE: blead: no longer supports %vd format
Robin Barker wrote: Attached patch reinstates VDf in blead perl to implement the %vd format, which is still used in XS code and will reappear in blead for read-only version numbers. Can someone apply this pretty please? Robin mispoke a little, in that "%vd" will be used in the core again once I submit a patch to make PL_patchlevel a readonly v-string instead of a version object. Version objects automatically ignore the "%vd" format either from Perl or XS level and print as if PVf was used instead. Thanks John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
[PATCH] RE: blead: no longer supports %vd format
Attached patch reinstates VDf in blead perl to implement the %vd format, which is still used in XS code and will reappear in blead for read-only version numbers. I have taken the opportunity to tidy up the code for the %p hacks that are used to proved SVf (was %_) and VDf. The format processing code does an initial pass for %p "extensions" and then resumes the previous processing. I have also added some comments to describe the use of %p. Robin --- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY --- vdnumber.patch Description: Binary data
RE: blead: no longer supports %vd format
John > I'm sorry that I didn't notice when you submitted the original patches > that you were nuking the VDf support. Is there some reason that the > '%-1p' hack cannot be re-added so that VDf could be supported in the > core as well as in XS modules? Because its a nasty hack that I never meant to go "mainstream" :-) > John Can you give me some C code/patch that generates something to be printed with %vd, perhaps the perl version stuff. I'll look at reinstating a hack for implementing VDf. Robin --- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY ---
Re: blead: no longer supports %vd format
Robin Barker wrote: I propose ALLOW_PERL_FORMAT a macro to allow non-standard (perl-defined) format in C code. with code in perl.h #ifdef ALLOW_PERL_FORMAT #defined VDf "vd" #endif and turning off the __printf__ attribution when ALLOW_PERL_FORMAT is set. I would hope that ALLOW_PERL_FORMAT would only be needed in XS, if it is set in the perl core, all the format checking would be lost. That's better than the current state of affairs, but I don't know that it is sufficient. As I mentioned before, I have a patch to change PL_patchlevel from a string that gets upgraded to a version object all over the place, to a read-only v-string that is used by $^V and $] to generate the standardized version output. _But_ that means that there are several places in the core where VDf would be needed. I'm sorry that I didn't notice when you submitted the original patches that you were nuking the VDf support. Is there some reason that the '%-1p' hack cannot be re-added so that VDf could be supported in the core as well as in XS modules? John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
RE: blead: no longer supports %vd format
-Original Message- From: John Peacock To: Robin Barker Cc: ''The Perl5 Porters Mailing List ' ' Sent: 09/07/05 00:56 Subject: Re: blead: no longer supports %vd format Robin Barker wrote: > My 23767 (and a few later patches) kept the -Wformat checking hacks hidden behind -DCHECK_FORMAT. The only change relevant to %vd is the > final hack which removed the VDf macro (usually defined as "vd") > because your patches had removed all appearances from the sources. But XS writers still need to be able to use "%vd" or the VDf macro in their own code. Just because it isn't in the core any longer doesn't mean we can stop supporting it completely (and several of the format macros need to be in ppperl.h for just this reason). In fact, I think that I like the idea of making PL_patchlevel a readonly v-string by default, instead of having to scatter upg_version()'s all over the source code (and I've got a patch to do it). > To reiterate, as far as I know, "%vd" still works - it just warns. Yes, it definitely works from the Perl and XS levels, but it warns when compiling the XS/C code. > The warnings can be silenced with gcc -Wall -Wno-format > or with C<#define __attribute__(x)> You mean stubbing out the attribute checking? What't the point of that? > Or C can be replaced by > C There is no macro or function called vstring() that will translate a v-string like the "%vd" format does. Can we just revert the bits of 23824 which eliminated the %vd handling only make it non-conditional on CHECK_FORMAT? John - John I propose ALLOW_PERL_FORMAT a macro to allow non-standard (perl-defined) format in C code. with code in perl.h #ifdef ALLOW_PERL_FORMAT #defined VDf "vd" #endif and turning off the __printf__ attribution when ALLOW_PERL_FORMAT is set. I would hope that ALLOW_PERL_FORMAT would only be needed in XS, if it is set in the perl core, all the format checking would be lost. Robin --- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY ---
Re: blead: no longer supports %vd format
Robin Barker wrote: My 23767 (and a few later patches) kept the -Wformat checking hacks hidden behind -DCHECK_FORMAT. The only change relevant to %vd is the final hack which removed the VDf macro (usually defined as "vd") because your patches had removed all appearances from the sources. But XS writers still need to be able to use "%vd" or the VDf macro in their own code. Just because it isn't in the core any longer doesn't mean we can stop supporting it completely (and several of the format macros need to be in ppperl.h for just this reason). In fact, I think that I like the idea of making PL_patchlevel a readonly v-string by default, instead of having to scatter upg_version()'s all over the source code (and I've got a patch to do it). To reiterate, as far as I know, "%vd" still works - it just warns. Yes, it definitely works from the Perl and XS levels, but it warns when compiling the XS/C code. The warnings can be silenced with gcc -Wall -Wno-format or with C<#define __attribute__(x)> You mean stubbing out the attribute checking? What't the point of that? Or C can be replaced by C There is no macro or function called vstring() that will translate a v-string like the "%vd" format does. Can we just revert the bits of 23824 which eliminated the %vd handling only make it non-conditional on CHECK_FORMAT? John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
RE: blead: no longer supports %vd format
-Original Message- From: John Peacock Cc: Robin Barker; 'The Perl5 Porters Mailing List ' Sent: 08/07/05 20:43 Subject: Re: blead: no longer supports %vd format > Robin Barker wrote: > >> Previously -DCHECK_FORMAT defined VDf + SVf differently, to avoid the >> warnings and allow -Wformat to check the formats. Ah ha, that's why you know what's going on! It's your fault... http://public.activestate.com/cgi-bin/perlbrowse?patch=23767 ;-) - Not guilty! My 23767 (and a few later patches) kept the -Wformat checking hacks hidden behind -DCHECK_FORMAT. The only change relevant to %vd is the final hack which removed the VDf macro (usually defined as "vd") because your patches had removed all appearances from the sources. Later patches (relating to the consting work) added attributes everywhere, not hidden by CHECK_FORMAT, and it became possible to remove %_ and have all kinds of gcc warnings work by default. To reiterate, as far as I know, "%vd" still works - it just warns. The warnings can be silenced with gcc -Wall -Wno-format or with C<#define __attribute__(x)> Or C can be replaced by C Robin --- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY ---
Re: blead: no longer supports %vd format
Robin Barker wrote: Previously -DCHECK_FORMAT defined VDf + SVf differently, to avoid the warnings and allow -Wformat to check the formats. Ah ha, that's why you know what's going on! It's your fault... http://public.activestate.com/cgi-bin/perlbrowse?patch=23767 ;-) John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Re: blead: no longer supports %vd format
John Peacock <[EMAIL PROTECTED]> writes: >Stas Bekman wrote: >> >> I don't think so. It doesn't happen with any perl < 5.9.3. >> > >I can't explain why gcc would suddenly take such a keen interest in >Perl's internal format strings. Because someone went round putting in __attribute__((printf,...)) in? >The warning can be safely ignored and >the %vd code works fine. Perhaps it is something to do with the >constification? > >John
Re: blead: no longer supports %vd format
Robin Barker wrote: Previously -DCHECK_FORMAT defined VDf + SVf differently, to avoid the warnings and allow -Wformat to check the formats. Patches welcome??? I'm already fighting a difference between how GCC 3.x and 4.x deal with multiple '-I' directives that is keeping version.pm from compiling under 4.0 on multiple platforms. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
RE: blead: no longer supports %vd format
gcc -Wall (or gcc -Wformat) complain about %vd and %_ because the functions they are used in now have an attribute that says they expect format strings. This attribute used to be conditional on -DCHECK_FORMAT but that was removed: when VDf (='vd') was removed and SVf was changed from '_' to a different hack. Previously -DCHECK_FORMAT defined VDf + SVf differently, to avoid the warnings and allow -Wformat to check the formats. Robin -Original Message- From: Stas Bekman To: John Peacock Cc: The Perl5 Porters Mailing List Sent: 08/07/05 20:01 Subject: Re: blead: no longer supports %vd format John Peacock wrote: > Stas Bekman wrote: > >> >> I don't think so. It doesn't happen with any perl < 5.9.3. >> > > I can't explain why gcc would suddenly take such a keen interest in > Perl's internal format strings. The warning can be safely ignored and > the %vd code works fine. Perhaps it is something to do with the > constification? Because perl doesn't take care of substituting it. It's the same problem as "%_" (the warning is the same), which no longer works (see my other post). perl used to kick in and handle %_ and %vd, it no longer does that. -- __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com --- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY ---
Re: blead: no longer supports %vd format
John Peacock wrote: Stas Bekman wrote: I don't think so. It doesn't happen with any perl < 5.9.3. I can't explain why gcc would suddenly take such a keen interest in Perl's internal format strings. The warning can be safely ignored and the %vd code works fine. Perhaps it is something to do with the constification? Because perl doesn't take care of substituting it. It's the same problem as "%_" (the warning is the same), which no longer works (see my other post). perl used to kick in and handle %_ and %vd, it no longer does that. -- __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: blead: no longer supports %vd format
Stas Bekman wrote: I don't think so. It doesn't happen with any perl < 5.9.3. I can't explain why gcc would suddenly take such a keen interest in Perl's internal format strings. The warning can be safely ignored and the %vd code works fine. Perhaps it is something to do with the constification? John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Re: blead: no longer supports %vd format
John Peacock wrote: Stas Bekman wrote: blead complains about Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel)); mod_perl.c:700: warning: unknown conversion type character `v' in format Now, wait a second! That error is being thrown by _GCC_, not Perl. That has been emitted ever since '-Wall' was turned on, AFAICT (indeed if I take it out of cflags and OPTIMIZE, the warning is not emitted). This isn't bleadperl's problem so much as GCC being too smart for its own good... I don't think so. It doesn't happen with any perl < 5.9.3. -- __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: blead: no longer supports %vd format
Stas Bekman wrote: blead complains about Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel)); mod_perl.c:700: warning: unknown conversion type character `v' in format Now, wait a second! That error is being thrown by _GCC_, not Perl. That has been emitted ever since '-Wall' was turned on, AFAICT (indeed if I take it out of cflags and OPTIMIZE, the warning is not emitted). This isn't bleadperl's problem so much as GCC being too smart for its own good... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Re: blead: no longer supports %vd format
John Peacock wrote: Stas Bekman wrote: blead complains about Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel)); mod_perl.c:700: warning: unknown conversion type character `v' in format why doesn't it work anymore? what format should I use instead? SVf? I'm investigating. However PL_patchlevel in blead is a version object (sort of), so I need to make sure that still works the way you expect it to. I didn't remove "%vd" support (though I did alter it so that for version objects, it is equivalent to "%s"). I just realized that may not work on PL_patchlevel, however, since that is a version object in form, but not in name. It happens that at the time that PL_patchlevel is created, there is no name stash in existence, and hence the bless into the "version" class has no effect. It just occurred to me that I can actually go back to storing PL_patchlevel as a v-string and just elevate it to a version object when needed (during output for $^V and $] or comparing). I'll work on a patch (I'm syncing blead right now). so those might be two different issues. In any case I'm now using the following workaround: #if PERL_REVISION == 5 && PERL_VERSION < 9 #define MP_PERL_VERSION_STAMP "Perl/v%vd" #else #define MP_PERL_VERSION_STAMP "Perl/%" SVf #endif [...] Perl_form(aTHX_ MP_PERL_VERSION_STAMP, PL_patchlevel)); -- __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: blead: no longer supports %vd format
Stas Bekman wrote: blead complains about Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel)); mod_perl.c:700: warning: unknown conversion type character `v' in format why doesn't it work anymore? what format should I use instead? SVf? I'm investigating. However PL_patchlevel in blead is a version object (sort of), so I need to make sure that still works the way you expect it to. I didn't remove "%vd" support (though I did alter it so that for version objects, it is equivalent to "%s"). I just realized that may not work on PL_patchlevel, however, since that is a version object in form, but not in name. It happens that at the time that PL_patchlevel is created, there is no name stash in existence, and hence the bless into the "version" class has no effect. It just occurred to me that I can actually go back to storing PL_patchlevel as a v-string and just elevate it to a version object when needed (during output for $^V and $] or comparing). I'll work on a patch (I'm syncing blead right now). John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748